LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

COM port question

Solved!
Go to solution

Here's the final version that works correctly.

 

1) Send carriage return to initiate

2) Wait, then send "ST" to begin automatic logging

3) Check the read buffer once per second. If there is data, read the whole line and append to array.

4) If while loop is stopped, send "SP" to stop the instrument, then clean up.

 

Now I just need to take care of parsing the data, graphing, saving for later, etc.

Thanks everyone for your help, I appreciate it! 

Cory K
0 Kudos
Message 21 of 25
(554 Views)

Something that might help you is this little VI I put together really quick.  It appends the carriage return to the string, sends the command, and then waits.  It will help quite a bit in cleaning up your code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 22 of 25
(545 Views)

You can also configure the port to add the CR automatically.

Message 23 of 25
(540 Views)

@Wayne.C wrote:

You can also configure the port to add the CR automatically.


I'll have to remember that one.  But it only seems like it will work if the Termination Character was enabled and the Read either has the same termination character or is not using the termination character.  You can manipulate all of these with a property node.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 24 of 25
(526 Views)

You are correct crossrulz.  Has to be a situation where both the send/rcv term characters are the same.   I run into that situation every now and then.

0 Kudos
Message 25 of 25
(521 Views)