LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging RS232 and analog data

Solved!
Go to solution

 

Thanks Raven, for looking at it.

 

Those items you mentioned are features in the instrument drivers.  I didn't write them.  I tried a few things but wasn't able to get a successful reading.  Manipulating the readSerialBuffer.vi read amount from 1 byte to more gives me nothing on the output string (basically I was just logging dates from my included date stamp on the concantenate string node.  

 

No luck.

 

 Ravens Fan wrote:

In the Set Point.vi there is a subVI called ReadSerialBuffer.  It reads the port 1 byte at a time until it gets nothing or the carriage return character.  Then the loop ends and clears the buffer.

 

First, it shouldn't be necessary to clear the buffers because you've basically read until the buffer should be empty.  It may take some time for VISA to actually clear the buffers.  Since this is something that Hyperterminal is definitely not doing, it could be an explanation for the apparently longer time.

 

It looks like you have the termination character in your INIT vi, but it is set for a line feed character by default.  Your ReadSerialBuffer vi is reading until you get a carriage return character.  It would make more sense to set your termination character to be the carriage return, and then read a sufficiently large number of bytes.  It will automatically terminate on the carriage return.  It would be a lot more efficient then reading a byte at a time and no loop would be necessary.


 

0 Kudos
Message 11 of 12
(395 Views)

Thanks Ravens Fan.

 

I replaced the clear serial buffer vi with a property node to report the VISA name and all is well in the logging rate world.  Seems all I can get is about 30 hz (way more than I need), likely due to the RS232 time per operation.

 

It works, I'm happy.  Thanks for the help.

 

Darren

0 Kudos
Message 12 of 12
(387 Views)