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
Another RS232 communication
14 posts
• Page 1 of 2 • 1, 2
Another RS232 communication
Hello everyone, i make an another machine control, this time is for controlling a laser marking machine, ( i love marking machine ). i need to send a part of a programm from my pc by rs 232. This time a need to make some sequence when my machine respond to the string i sended. when the machine send the good anwser i send an another string but i can't send the entire answer because I need to send a "," in my string and this send only the string before that "," some one know how to send the entire string ? the support of FS send me an example i give this attached to this message.
- RZK
- Posts: 23
- Joined: Mon Dec 23, 2013 9:50 am
Re: Another RS232 communication
hello, make a string input instead of a string array input and use the split methode
with the split methode you split a string into array elements at a defined seperator like on every "return / newline".... data = @data.split(/\r\n/)
this should do the job if i understood your question right
with the split methode you split a string into array elements at a defined seperator like on every "return / newline".... data = @data.split(/\r\n/)
this should do the job if i understood your question right
- Attachments
-
- Com ACK system split to array.fsm
- (9.93 KiB) Downloaded 3868 times
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Another RS232 communication
Thank's for your help Nubeat7 ! Where can i learn Ruby code ?
- RZK
- Posts: 23
- Joined: Mon Dec 23, 2013 9:50 am
Re: Another RS232 communication
Hi everyone, One more think, i have a response code "0" from my machine when the command sent is succesfull but when i use a IfThenElse module, the "0" is like nothing(empty case). then i can't compare the response incomming from com port to send another line. Or it send a new command always enven if i don't have 0 incomming trough the com port. it make me mad ><. i try on 3 differents types on the ifthenelse (float int and string, its do the same.)
Thank's for your help guys !
To simulate the machine i used a another program and i have pair com1 and com2 with a portcom simulator.
Thank's for your help guys !
To simulate the machine i used a another program and i have pair com1 and com2 with a portcom simulator.
- RZK
- Posts: 23
- Joined: Mon Dec 23, 2013 9:50 am
Re: Another RS232 communication
it's good i use a in out in ruby code to have "[]" at output and i compare with a if then else to a empty [] or with 0 and 1. i have delay to wait response from my machine to my pc when i send a string, but i can't stop the flow of my send even if i don't have response trough the com port.i use a other flowstone program to simulate my machine and a port com simulator to communicate with the 2 programs. the first programm send a string and the second programm send 0 or 1 when it receive something. but when close the second com port the programm 1 continue to send string flow.
- RZK
- Posts: 23
- Joined: Mon Dec 23, 2013 9:50 am
Re: Another RS232 communication
my first programm here to be fixed. If some one have an idea of my problem
- Attachments
-
- test_sequencestop060614+restart.fsm
- (173.37 KiB) Downloaded 3684 times
- RZK
- Posts: 23
- Joined: Mon Dec 23, 2013 9:50 am
Re: Another RS232 communication
my second programm working with the first. i use VSPEmulator to pair my simulated com1 and com2
- RZK
- Posts: 23
- Joined: Mon Dec 23, 2013 9:50 am
Re: Another RS232 communication
That's 3vi1 Schematic E-Ville
"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: Another RS232 communication
I am so glad i use 7x64 & have DEP enabled, just too many insane modules would have eaten all my ram.
Like this one ;
Like this one ;
- Attachments
-
- capture.png (125.83 KiB) Viewed 83074 times
"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
14 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 0 guests