Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with load cell using virtual serial port

Solved!
Go to solution

Hello! I am trying to read from my load cell using VISA write and read. Below is my vi. The load cell is using ASCII protocol. I have suceeded using Hyperterminal to communicate to my load cell, but I can't get it working in Labview with exactly the same settings and command. Does anyone know what's the problem here? Thanks!

stargazerl_0-1659969434885.png

 

0 Kudos
Message 1 of 6
(1,826 Views)
Solution
Accepted by topic author stargazerl

You are not to send "<CR>".  That is supposed to be a single character: a Carriage Return (ASCII value of 13, 0xD).  This might be the case where using the ASRL End Out property would be very useful.  Set that property to Termination Character and the Carriage Return will be appended for you by the VISA driver.



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 2 of 6
(1,819 Views)

Thank you very much for the reply! I am fresh to Labview, I can't find ASRL End Out property in the property node. Could you tell me where it is so that I could give it a try? Much appreciated!

0 Kudos
Message 3 of 6
(1,811 Views)

I found it! It is working now. Thank you very much!

 

So the problem was that the end of commands were not sent correctly? And how does ASRL End Out solve this problem? 

0 Kudos
Message 4 of 6
(1,807 Views)

Put down a property node and wire up the VISA resource to the reference.  Click on the property and choose Serial Settings->End Mode for Writes.

 

Due note that this property is only valid for serial ports.  I don't normally recommend this route because I work with instruments that can also communicate over GPIB, Ethernet, and/or USB.  So I usually use Concatenate String  and a Carriage Return Constant to add the CR and then wire that result to the VISA Write.



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 5 of 6
(1,804 Views)

@stargazerl wrote:

So the problem was that the end of commands were not sent correctly? And how does ASRL End Out solve this problem? 


1. Correct.  You were sending 4 characters that the device has no clue what to do with ("<CR>").  What the device really wanted was a single character.

 

2. As I stated before, this property tells the VISA driver to append the termination character, in this case the Carriage Return, whenever a write is performed.  So the driver is handling the termination character for you once it is initialized.



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 6 of 6
(1,802 Views)