Problem mit RPP-Listen
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
Problem mit RPP-Listen
Hallo zusammen,
ich habe ein Problem mit einer RoboPro-Liste, also einem Array. Den entsprechenden Teil des Programms, der interessant ist, gibts hier:
http://www.martin-westphal.de/ftc/liste-problem.rpp
Das gesamte Programm (Achtung, unübersichtlich) gibts hier, falls es jemanden interessiert: http://www.martin-westphal.de/ftc/hochr ... uerung.rpp Relevante UPs wären Platz_anfahren, Platz_belegen, Liste_Faecher und Fachsuche.
Und jetzt zum Problem: Völlig egal, was ich in die Liste reinschreiben lasse (0, 1, 2, 3, was auch immer), rpp speichert immer ein "?" statt dem gewünschten Wert. Und das kann ich dann logischerweise nicht mehr richtig auslesen. Die Liste ist in einem Unterprogramm, da an mehreren Stellen auf sie zugegriffen wird. So habe ich die Möglichkeit dazu, mehrfach die Liste direkt verwenden mag rpp nicht.
Hat jemand eine Idee? Ich habe ehrlich gesagt keine mehr.
Danke & Schöne Grüße,
Martin
ich habe ein Problem mit einer RoboPro-Liste, also einem Array. Den entsprechenden Teil des Programms, der interessant ist, gibts hier:
http://www.martin-westphal.de/ftc/liste-problem.rpp
Das gesamte Programm (Achtung, unübersichtlich) gibts hier, falls es jemanden interessiert: http://www.martin-westphal.de/ftc/hochr ... uerung.rpp Relevante UPs wären Platz_anfahren, Platz_belegen, Liste_Faecher und Fachsuche.
Und jetzt zum Problem: Völlig egal, was ich in die Liste reinschreiben lasse (0, 1, 2, 3, was auch immer), rpp speichert immer ein "?" statt dem gewünschten Wert. Und das kann ich dann logischerweise nicht mehr richtig auslesen. Die Liste ist in einem Unterprogramm, da an mehreren Stellen auf sie zugegriffen wird. So habe ich die Möglichkeit dazu, mehrfach die Liste direkt verwenden mag rpp nicht.
Hat jemand eine Idee? Ich habe ehrlich gesagt keine mehr.
Danke & Schöne Grüße,
Martin
Re: Problem mit RPP-Listen
Nabend,
niemand eine Idee? Hat sichs überhaupt jemand angeschaut? Könnte ja auch sein, dass ich einen grundsätzlichen Fehler im Umgang mit dem Listen-Element mache.
Wäre schön, wenn jemand ne Idee hätte.
Schöne Grüße,
Martin
niemand eine Idee? Hat sichs überhaupt jemand angeschaut? Könnte ja auch sein, dass ich einen grundsätzlichen Fehler im Umgang mit dem Listen-Element mache.
Wäre schön, wenn jemand ne Idee hätte.
Schöne Grüße,
Martin
Re: Problem mit RPP-Listen
Hello Martin,
Quite a program you have made, but difficult to understand without a functional description. There is however one thing that is certainly erroneous: in the subprogram 'Fachsuche' the write input (S) of the List element is only connected to a minus operator with one input (the negation), but there is no value (e.g. a variable) connected to it. What value do you want to write into the list?
Maybe this helps a little.
Good luck, Han.
Quite a program you have made, but difficult to understand without a functional description. There is however one thing that is certainly erroneous: in the subprogram 'Fachsuche' the write input (S) of the List element is only connected to a minus operator with one input (the negation), but there is no value (e.g. a variable) connected to it. What value do you want to write into the list?
Maybe this helps a little.
Good luck, Han.
Re: Problem mit RPP-Listen
Hello Han,
in "Fachsuche", there is nothing written into the array. But RoboPro doesn't allow it to leave a pin of a subprogram open, so i had to connect it to anything. Without any inputs, the operators dont't give anything out, so this should not matter(Or does it matter and I'm doing wrong?).
Well, I could have added a short description. Its a program for the new "Hochregal" from Automation Robots. Its built on the example program of fischertechnik, which has no saving of the occupied places.
Und auf deutsch:
Im UP Fachsuche soll Nichts in die Liste geschrieben werden. Allerdings akzeptiert RoboPro es nicht, wenn ein UP mit offenen Anschlüssen gelassen wird. Also muss irgendwas angeschlossen werden, in diesem Fall ein Operator. Der sollte eigentlich Nichts tun, solange er keinen Eingang bekommt. Oder sehe ich das falsch?
Ich hätte eine kurze Beschreibung mitgeben können...Es ist ein Programm für das neue "Hochregal" aus Automation Robots, dass ich größer gebaut und etwas angepasst habe. Das Programm basiert auf dem Beispielprogramm von ft, dass allerdings keine Speicherung der belegten Fächer hat. Das soll hier ergänzt sein.
Schöne Grüße,
Martin
in "Fachsuche", there is nothing written into the array. But RoboPro doesn't allow it to leave a pin of a subprogram open, so i had to connect it to anything. Without any inputs, the operators dont't give anything out, so this should not matter(Or does it matter and I'm doing wrong?).
Well, I could have added a short description. Its a program for the new "Hochregal" from Automation Robots. Its built on the example program of fischertechnik, which has no saving of the occupied places.
Und auf deutsch:
Im UP Fachsuche soll Nichts in die Liste geschrieben werden. Allerdings akzeptiert RoboPro es nicht, wenn ein UP mit offenen Anschlüssen gelassen wird. Also muss irgendwas angeschlossen werden, in diesem Fall ein Operator. Der sollte eigentlich Nichts tun, solange er keinen Eingang bekommt. Oder sehe ich das falsch?
Ich hätte eine kurze Beschreibung mitgeben können...Es ist ein Programm für das neue "Hochregal" aus Automation Robots, dass ich größer gebaut und etwas angepasst habe. Das Programm basiert auf dem Beispielprogramm von ft, dass allerdings keine Speicherung der belegten Fächer hat. Das soll hier ergänzt sein.
Schöne Grüße,
Martin
Re: Problem mit RPP-Listen
Hello Martin,
Now I understand why you use this minus operator. It remains however the cause of your problem. After writing some small test program I found this:
- after starting a program or entering a subprogram this operator sends a zero through its output. It does that every time the subprogram is entered.
- if you connect the minus operator directly to the write (S) input of a list element, this zero will be written in the list (on the place where the index points to at that moment)
- if the minus operator is connected via the S-input of a subprogram (as you have done with 'Liste_Faecher') a question mark is written in the list. I don't understand why this is different from the previous way. But it explains why your List is filled with question marks.
The solution is simple: split up your subprogram Liste-Faecher in two different ones, one for reading and one for writing. Or, alternatively, bring the List element directly in the subprograms Platzbelegen and Fachsuche.
Schöne Grüße, Han
Now I understand why you use this minus operator. It remains however the cause of your problem. After writing some small test program I found this:
- after starting a program or entering a subprogram this operator sends a zero through its output. It does that every time the subprogram is entered.
- if you connect the minus operator directly to the write (S) input of a list element, this zero will be written in the list (on the place where the index points to at that moment)
- if the minus operator is connected via the S-input of a subprogram (as you have done with 'Liste_Faecher') a question mark is written in the list. I don't understand why this is different from the previous way. But it explains why your List is filled with question marks.
The solution is simple: split up your subprogram Liste-Faecher in two different ones, one for reading and one for writing. Or, alternatively, bring the List element directly in the subprograms Platzbelegen and Fachsuche.
Schöne Grüße, Han
Re: Problem mit RPP-Listen
Hello Han,
thank you for testing and explaining. I will try it out later this day.
Sinngemäße Deutsche Übersetzung des Vorgängerbeitrags für Alle, die kein Englisch können:
Martin
thank you for testing and explaining. I will try it out later this day.
Sinngemäße Deutsche Übersetzung des Vorgängerbeitrags für Alle, die kein Englisch können:
Thanks & Greetings,Han hat geschrieben:Die Ursache des Problems ist der Minus-Operator. Nach mehreren Testprogrammen habe ich folgendes herausgefunden:
- nach jedem Start oder Aufruf des Unterprogramms sendet der Operator eine Null an seinen Ausgang
- Wenn der Operator direkt an einen S-Eingang einer Liste angeschlossen ist, schreibt er diese Null in das aktuelle Element
- Wenn der Operator über einen Eingang eines Unterprogramms angeschlossen ist (so wie in diesem Programm), wird ein Fragezeichen in die Liste geschrieben. Den Unterschied zum vorherigen Punkt verstehe ich nicht, aber es erklärt, warum deine Liste mit Fragezeichen gefüllt wird.
Die Lösung ist einfach: Unterprogramm in zwei unterschiedliche UPs aufteilen, eines zum Lesen, eines zum schreiben. Oder das Listenelement direkt in die Unterprogramme einfügen.
Martin
Re: Problem mit RPP-Listen
Hallo zusammen,
YES! Now it works fine. I've added a new global var "belegung", which transfers the 0/1 from Platz belegen to Fachsuche. In exchange I deleted the Input of the Liste-subprogram.
Now I can build further options like a conveyor belt etc.
Thanks a lot, I went crazy about this small problem...
Deutsch:
YES! Jetzt läufts. Ich habe eine neue globale Variable "belegung" hinzugefügt, die die Belegung 0/1 von Platz belegen zu Fachsuche bringt. Dafür ist der S-Eingang des Listen-UP rausgeflogen.
Jetzt kann ich mich weiteren Anbauten wie einem Zulieferer-Transportband widmen.
Grüße,
Martin
YES! Now it works fine. I've added a new global var "belegung", which transfers the 0/1 from Platz belegen to Fachsuche. In exchange I deleted the Input of the Liste-subprogram.
Now I can build further options like a conveyor belt etc.
Thanks a lot, I went crazy about this small problem...
Deutsch:
YES! Jetzt läufts. Ich habe eine neue globale Variable "belegung" hinzugefügt, die die Belegung 0/1 von Platz belegen zu Fachsuche bringt. Dafür ist der S-Eingang des Listen-UP rausgeflogen.
Jetzt kann ich mich weiteren Anbauten wie einem Zulieferer-Transportband widmen.
Grüße,
Martin
Re: Problem mit RPP-Listen
Hi Martin.
Nice to hear it works now. And yes, small problems can make you crazy and become big problems then. It reminds me how many hours, days, or more I have spent searching errors in my own programs. But nevertheless I sometimes like these problems. They sharpen the mind and it is rewarding to solve them.
Grüße, Han
Nice to hear it works now. And yes, small problems can make you crazy and become big problems then. It reminds me how many hours, days, or more I have spent searching errors in my own programs. But nevertheless I sometimes like these problems. They sharpen the mind and it is rewarding to solve them.
Grüße, Han