ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

basic serial write strings

Hi

I'm using the Basic Serial Read Write Example that came with labview to send serial commands to a motor (Silvermax), except i'm not exactly sure what kind of string i'm supposed to enter into the "write" box of the VI.  I ran some commands through the motor's original program, (not labview), and had it log its commands in ASCII to a file.  With that file, here's some of the command lines that i got for moving the motors:

TX:500ms =@16 135 -8021 7731 32212255 0 0 
RX:531ms =* 1
RX:531ms =0
TX:546ms =@16 128 
RX:562ms =* 1
RX:562ms =0
TX:578ms =@16 10 
RX:593ms =*
RX:593ms = 10
TX:531ms =@16 5 
RX:546ms =#
RX:546ms = 10 0005 1126 2001 0434 C815
RX:562ms =
TX:562ms =@16 
RX:578ms =# 1
RX:578ms =0 0000 2000
TX:593ms =@16 1 65535 
RX:609ms =* 1
RX:609ms =0
TX:625ms =@16 3 500000 
RX:640ms =*
RX:640ms = 10
TX:640ms =@16 
RX:656ms =# 1
RX:671ms =0 0000 2000
TX:671ms =@16 1 65535 
RX:687ms =* 1
RX:703ms =0
TX:703ms =@16 207 0 0 
RX:718ms =* 1
RX:734ms =0
TX:734ms =@16 245 0 
RX:750ms =* 1
RX:750ms =0
TX:765ms =@16 5 
RX:781ms =#
RX:781ms = 10 0005 1126 2001 0434
RX:781ms = C815
TX:796ms =@16 8 
RX:812ms =* 1
RX:812ms =0
TX:812ms =@16 9 
RX:828ms =* 1
RX:843ms =0


Obviously, this is a rather long set of code commands that i got for just moving the motors once to a certain distance.  Since there are so many lines to this, which one am i supposed to enter as the write string? and am i supposed to enter something into the 'read' string part as well? 

I've tried entering the first TX line by itself, for example "@16 135 -8021 7731 32212255 0 0" as the 'write' string, and hit the run button on the labview window.  I didn't get any error messages, (which is good), but the labview program automatically stops itself.. or sometimes freezes up, but my motors don't move at all.  Am i supposed to include the '@' in it as well? or am i missing some other symbols/syntax that labview requires?

The motors's baud rate is 57600, data bits is 8. and i've already entered these into the VI.

Any help will be greatly appreciated, I really want to get this motor working with labview.  Thanks

Cheers
Michelle
0 Kudos
Message 1 of 6
(3,693 Views)
Hello,

This might be useful to you:  Silvermax  

Cheers!
0 Kudos
Message 2 of 6
(3,690 Views)
lol..

i just read that other post, but i think i need more help before i can reach that stage.  my problem is that i don't even know what string to put into the write/read text box and what not to put in.  i already have a 500ms delay, is that too much?  Any other suggestions? thanks.

michelle
0 Kudos
Message 3 of 6
(3,681 Views)
Here is another post by that same user.  There is a VI attached in his post that may be able to get you started, it seems that you need to be careful with the termination character as well.  Goodluck!

Cheers
0 Kudos
Message 4 of 6
(3,675 Views)

Have you communicated to the motor using a program like HyperTerminal (or similar)?

If so, what commands do you send?  How are they sent?  ie: is there a carriage return after every command or can you send a mutiple-instruction string?

What does the manufacturer suggest when communicating with the motor?  Do they provide examples?  What about communication setup (speed, etc), confirm the settings work?

Before automating, I would suggest being able to communicate at least manually with the target, and to try out a couple of commands.  Once that is done, implementing is LV is quite easy.

RayR

 



Message Edited by JoeLabView on 11-26-2007 12:18 PM
0 Kudos
Message 5 of 6
(3,672 Views)
Hey,

i finally got the motors to move.  I was missing the carriage return of '\r' after the command line.  I only needed to enter in 1 line of string though, and it would stop automatically.  i just can't put in multiple strings at a time.  I also didn't have to put any string into the 'read' box of the VI.  After my motors move, a string appears in the box.  is this supposed to be how it works?  thanks for all the help.

cheers
michelle
0 Kudos
Message 6 of 6
(3,649 Views)