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

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

Discuss Control Systems here

Another RS232 communication

Postby RZK » Mon May 26, 2014 10:35 am

Hello everyone, i make an another machine control, this time is for controlling a laser marking machine, ( i love marking machine :cry: ). 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.

Com ACK system (1).fsm
(4.72 KiB) Downloaded 3912 times
RZK
 
Posts: 23
Joined: Mon Dec 23, 2013 9:50 am

Re: Another RS232 communication

Postby Nubeat7 » Tue May 27, 2014 8:51 pm

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
Attachments
Com ACK system split to array.fsm
(9.93 KiB) Downloaded 3868 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Another RS232 communication

Postby RZK » Mon Jun 02, 2014 7:39 am

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

Postby RZK » Tue Jun 03, 2014 2:46 pm

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.

test_sequence nonstop030614t.fsm
(38.69 KiB) Downloaded 3862 times
RZK
 
Posts: 23
Joined: Mon Dec 23, 2013 9:50 am

Re: Another RS232 communication

Postby RZK » Tue Jun 10, 2014 8:34 am

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.
forum.png
my in out
forum.png (130.14 KiB) Viewed 83220 times
RZK
 
Posts: 23
Joined: Mon Dec 23, 2013 9:50 am

Re: Another RS232 communication

Postby RZK » Tue Jun 24, 2014 9:50 am

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

Postby RZK » Tue Jun 24, 2014 9:52 am

Retour miyachi 060614.fsm
(52.18 KiB) Downloaded 3788 times
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

Postby JB_AU » Wed Jun 25, 2014 10:20 am

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

Re: Another RS232 communication

Postby RZK » Fri Jun 27, 2014 10:59 am

WHat ?? xD :?
RZK
 
Posts: 23
Joined: Mon Dec 23, 2013 9:50 am

Re: Another RS232 communication

Postby JB_AU » Sat Jun 28, 2014 10:06 am

I am so glad i use 7x64 & have DEP enabled, just too many insane modules would have eaten all my ram.
Like this one ;
Attachments
capture.png
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
User avatar
JB_AU
 
Posts: 171
Joined: Tue May 21, 2013 11:01 pm

Next

Return to Machine Control

Who is online

Users browsing this forum: No registered users and 0 guests