LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial port communication problems

Solved!
Go to solution
Solution
Accepted by Giant_Spiders

Giant Spiders wrote:
I have tried both 0xD and 0xA and neither seems to work.  According to the manual for my device, all messages must us a carriage reurn-line feed as the end-of-line delimiter, which is why I used 0xD.

You do realize, don't you, that the enable termination character and ther term character itself have nothing at all to do with the data that is sent to the instrument?

 

What is sent to the instrument is the data in the 'string to write' control and you would need a \r or \n at the end of your command.

Message 11 of 16
(1,936 Views)
Take a look at the Basic Read and Write Example. In the beginning of the VI is a VI to initalize the serial port settings. You can play with those to see what will work. One of the options is to use 7-bit ASCII.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 12 of 16
(1,935 Views)

Dennis,

 

Thanks for that info.  I was assuming the termination character was referring to the end-of-line delimiter.  Basic Serial Write and Read puts a \n for you, but I needed a \r and no \n.  That's got it working.  Thanks!

0 Kudos
Message 13 of 16
(1,932 Views)
Nice catch, Dennis!
0 Kudos
Message 14 of 16
(1,921 Views)

Giant Spiders wrote:

Dennis,

 

Thanks for that info.  I was assuming the termination character was referring to the end-of-line delimiter.  Basic Serial Write and Read puts a \n for you, but I needed a \r and no \n.  That's got it working.  Thanks!


 

You should look at the advanced serial write and read to see how to set it to automatically append a character when doing a write.
Message 15 of 16
(1,913 Views)
Thanks, Dennis.  I looked at the Advanced Serial VI and used that as a model.  I now have all my VI's written, and I have perfect communication with my pressure controller.
0 Kudos
Message 16 of 16
(1,890 Views)