Support

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

Auto Com ?

Discuss Control Systems here

Auto Com ?

Postby JB_AU » Tue Jul 29, 2014 2:43 pm

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".
cyclic_array.png
cyclic_array.png (19.84 KiB) Viewed 21673 times
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

Albert Einstein
User avatar
JB_AU
 
Posts: 196
Joined: Tue May 21, 2013 11:01 pm

Re: Auto Com ?

Postby MyCo » Tue Jul 29, 2014 3:20 pm

This could be done in Ruby way easier...
Attachments
port_validation.fsm
(1.83 KiB) Downloaded 742 times
User avatar
MyCo
 
Posts: 764
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Auto Com ?

Postby JB_AU » Tue Jul 29, 2014 5:44 pm

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
User avatar
JB_AU
 
Posts: 196
Joined: Tue May 21, 2013 11:01 pm

Re: Auto Com ?

Postby tester » Tue Jul 29, 2014 6:47 pm

Beta 3.0.5
Crashes here too.
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
 
Posts: 1796
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Auto Com ?

Postby RZK » Thu Jul 31, 2014 1:40 pm

same to me
RZK
 
Posts: 29
Joined: Mon Dec 23, 2013 9:50 am

Re: Auto Com ?

Postby JB_AU » Fri Aug 01, 2014 1:50 am

This is as far as i got ;
regq_autocom.fsm
(30.4 KiB) Downloaded 723 times


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
User avatar
JB_AU
 
Posts: 196
Joined: Tue May 21, 2013 11:01 pm

Re: Auto Com ?

Postby JB_AU » Fri Aug 01, 2014 1:25 pm

I got a little farther thanks to Trog clarifying a few things & now i have a migraine.

Please spot what is wrong?

regq_autocom.fsm
(30.52 KiB) Downloaded 747 times
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

Albert Einstein
User avatar
JB_AU
 
Posts: 196
Joined: Tue May 21, 2013 11:01 pm

Re: Auto Com ?

Postby MyCo » Fri Aug 01, 2014 1:31 pm

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.
User avatar
MyCo
 
Posts: 764
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Auto Com ?

Postby trogluddite » Fri Aug 01, 2014 2:05 pm

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!
User avatar
trogluddite
 
Posts: 984
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Auto Com ?

Postby JB_AU » Tue Aug 05, 2014 9:44 am

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.

regq_autocom.fsm
(29.84 KiB) Downloaded 751 times
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

Albert Einstein
User avatar
JB_AU
 
Posts: 196
Joined: Tue May 21, 2013 11:01 pm

Next

Return to Machine Control

Who is online

Users browsing this forum: No registered users and 2 guests