Page 1 of 2
Another RS232 communication
Posted: Mon May 26, 2014 10:35 am
by RZK
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.
Re: Another RS232 communication
Posted: Tue May 27, 2014 8:51 pm
by Nubeat7
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
Re: Another RS232 communication
Posted: Mon Jun 02, 2014 7:39 am
by RZK
Thank's for your help Nubeat7 ! Where can i learn Ruby code ?
Re: Another RS232 communication
Posted: Tue Jun 03, 2014 2:46 pm
by RZK
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.
Re: Another RS232 communication
Posted: Tue Jun 10, 2014 8:34 am
by RZK
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.

- my in out
- forum.png (130.14 KiB) Viewed 127390 times
Re: Another RS232 communication
Posted: Tue Jun 24, 2014 9:50 am
by RZK
my first programm here to be fixed. If some one have an idea of my problem
Re: Another RS232 communication
Posted: Tue Jun 24, 2014 9:52 am
by RZK
my second programm working with the first. i use VSPEmulator to pair my simulated com1 and com2
Re: Another RS232 communication
Posted: Wed Jun 25, 2014 10:20 am
by JB_AU
That's 3vi1 Schematic E-Ville
Re: Another RS232 communication
Posted: Fri Jun 27, 2014 10:59 am
by RZK
WHat ?? xD

Re: Another RS232 communication
Posted: Sat Jun 28, 2014 10:06 am
by JB_AU
I am so glad i use 7x64 & have DEP enabled, just too many insane modules would have eaten all my ram.
Like this one ;