11-03-2010 04:27 AM
Hello,
I am writing a vi to acquire data from a Thurlby Thandar 1906 Multimeter. When I use Hyperterminal I can use the commands "LAD" (Get ready to talk) and READ? (Read the buffer). I can acquire the measured value from the unit.
When I run the following vi I find that it consistently reads 0.000 which is incorrect.
Can anybody see what I am doing wrong?
Nevica
Solved! Go to Solution.
11-03-2010 04:48 AM - edited 11-03-2010 04:49 AM
What is unusual about this vi is the following:
When I highlight execution I find the following. Values shown in diagram appear almost instantaneously. ie the 0.00e+0 seems to appear before the buffer has been read. I dont understand how this can be so as Labview is supposed to carry out operations from left-to-right?
Nevica
11-03-2010 04:59 AM
Hi nevica,
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
When I highlight execution I find the following. Values shown in diagram appear almost instantaneously. ie the 0.00e+0 seems to appear before the buffer has been read. I dont understand how this can be so Labview is supposed to carry out operations from left-to-right?
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
labview code does not execute from Left - right. It follows dataflow model. As soon as data is available to all required terminal of a node it will execute.
Position of block does not matter.
About your problem, I don't see any error in the block diagram. it shows "Ok". Check if serial configuration is correct or not.
Like baud rate and all...
11-03-2010 05:06 AM
Serial configuration is correct. Could it be something to do with line feeds?
Nevica
11-03-2010 05:18 AM
Hello,
Where does the value highlighted below originate? How is it being read without first the VISA read command activating. The value highlighted appears almost instantaneoulsy the loop starts!
Nevica
11-03-2010 05:41 AM
When I read the numbers of bytes read on the last read command I find that no bytes are being read.
I know that the miltimeter is being read as it beeps when this happens. Because of this I know that the VISA seetings are correct. Yet, it is reading the incorrect value.
Nevica
11-03-2010 05:59 AM
Hi nevica,
That is not causing error in your code. Let me tell you again, When you run any code all inputs are available at the executing node, except the inputs which are output from some other node. In your case the value 0.00E+0 is nothing but input "Default" to the node. So it will be available at this node immediately when you run the code.Whereas String output from serial read function will appear when the read function executes.
Can you remove 1st two blocks and try your code. I am not sure this will work but just want you to try. Refer image.
11-03-2010 06:04 AM
Also try this
Write LAD first wait for few milliseconds then write READ? wait again and then use read function
This might work.I think your code executes before it could read from serial port.
11-03-2010 08:52 AM
Hello,
I have discovered what the problem is.
The instrument has been expecting a "line feed" instead of a "carriage return" as the instrument manual stated.
The vi works now!
Nevica