If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Auto Com ?
12 posts
• Page 1 of 2 • 1, 2
Auto Com ?
I am overly unkeen to learn ruby, i have good reason not to. Is there a way to make an index or an array cycle through based on a triggered event?
In my picture i have pulled a dynamic array of past & present com ports from registry for a particuar piece of hardware, i need to cycle through the array & test against the static array of available com ports, if there is a match , another module will use this value to test the hardware for acknowledgement or its presence. If the hardware exists stop cycling, if it does not keep cycling, timeout send msg "Check Hardware".
In my picture i have pulled a dynamic array of past & present com ports from registry for a particuar piece of hardware, i need to cycle through the array & test against the static array of available com ports, if there is a match , another module will use this value to test the hardware for acknowledgement or its presence. If the hardware exists stop cycling, if it does not keep cycling, timeout send msg "Check Hardware".
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
Albert Einstein
Albert Einstein
-
JB_AU - Posts: 171
- Joined: Tue May 21, 2013 11:01 pm
Re: Auto Com ?
This could be done in Ruby way easier...
- Attachments
-
- port_validation.fsm
- (1.83 KiB) Downloaded 3582 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Auto Com ?
Can't open it "Made with newer version" so what's newer than 3.0.4?
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
Albert Einstein
Albert Einstein
-
JB_AU - Posts: 171
- Joined: Tue May 21, 2013 11:01 pm
Re: Auto Com ?
Beta 3.0.5
Crashes here too.
Crashes here too.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: Auto Com ?
This is as far as i got ;
I either need to compare arrays & find the integer that exists in both or cycle through the array when more than 1 com exists per device. Then add some indicators, simplify the resulting module.
I either need to compare arrays & find the integer that exists in both or cycle through the array when more than 1 com exists per device. Then add some indicators, simplify the resulting module.
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
Albert Einstein
Albert Einstein
-
JB_AU - Posts: 171
- Joined: Tue May 21, 2013 11:01 pm
Re: Auto Com ?
I got a little farther thanks to Trog clarifying a few things & now i have a migraine.
Please spot what is wrong?
Please spot what is wrong?
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
Albert Einstein
Albert Einstein
-
JB_AU - Posts: 171
- Joined: Tue May 21, 2013 11:01 pm
Re: Auto Com ?
Have you tried my schematic with the new Amber release? Sorry, no time for testing at the moment, will have a look on the weekend.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Auto Com ?
JB_AU wrote:Please spot what is wrong?
Hi there. the problem is with the way that the Ruby inputs are read. The error is because variables '@in1' and '@in2' are not defined.
When you read inputs, the default way is...
- The top input is always just "@in".
- To read more, you get all of the inputs as an array called "@ins" - and then read the array. e.g. @ins[0] & @ins[1]
However, a much nicer way to do it, is to use named inputs. It makes the code easier to read, and you can change the order of the inputs without having to edit the code.
If you highlight the RubyEdit primitive, then CTRL click a connector, you can type a label for the connector. (hint - use TAB to move to the next one).
A variable gets made automatically to match the label. So input "in1" becomes variable "@in1", label "comms_list" becomes variable "@comms_list" etc.
You can then read the inputs by using the new variables.
Take care with the input labels
- don't include the '@' in the connector label, Ruby adds that automatically.
- name must start with a letter.
- no spaces in the name
- only letters, numbers and '_' may be used.
- make sure the input name doesn't clash with any of the other variables in your code.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Auto Com ?
Closer to the end now! It should work, it should???
It sometimes works , i saw it work, then it did not , then it worked & now it does not.... ever....
I am at a loss ?
My apologies for the all over the place web of links.
It sometimes works , i saw it work, then it did not , then it worked & now it does not.... ever....
I am at a loss ?
My apologies for the all over the place web of links.
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
Albert Einstein
Albert Einstein
-
JB_AU - Posts: 171
- Joined: Tue May 21, 2013 11:01 pm
12 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 4 guests