LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 74 Unflattened From String for VISA Read

The way you are using the Bytes at Port there is a very little chance this will work.

I am sure the Unflatten From String is correct in throwing an error.

 

The first time through the loop the the Bytes at Port most likely returns a '0' or something less than is need to read in your full cluster because the VISA Write most likely is not done sending every thing.

Then the unflatten is correct to throw an error.

 

As a quick test get rid of the Bytes at Port.

Wire the "Return Count" from the VISA Write into the "Byte Count" of the VISA Read.

You might meed to flush the read buffer before the VISA Write to make sure there is not garbage left over from before.

 

See if you get a different result.

 

 Which is what Oligarlicky told you.

Omar
0 Kudos
Message 11 of 16
(990 Views)

>> What would be the best way to compare the sent and receive strings?

 

They are 12 symbols each, you can display them side by side. And change display mode (in right click meny) from "Normal" to "HEX" to see all characters

0A, 0D are new line and carriage return symbols, they might make a difference

0 Kudos
Message 12 of 16
(975 Views)

I didn't think about wiring the return cound from VISA write to the byte count of VISA read. Thank you. I will try this later and get back to you.

0 Kudos
Message 13 of 16
(973 Views)

Hello,

 

I started this thread back in August about the above mentioned Error 74. I am now getting it again for a different reason. I am able to send information at a baud rate of 9600 with no errors. The hardware in my system requires a baud rate of 1.2M, but if I wire that value to the baud rate input of Visa Serial Configure VI, I get a Error 74 at my unflatten from string at the serial read VI. My serial cards are capable of baud rates up to 3Mbps so it is not the hardware. Should I use a dfferent VI to accomplish this? Any help would be appreciated. I am unable to post pictures of the model right now. Thank you.

0 Kudos
Message 14 of 16
(843 Views)

Hi Scaz,

 

I think you may be getting this error because your data might be offset. You might be sending data too quickly. This can cause a data overwrite to occur in software. If that happens, your data will be shifted and appear corrupted to the unflatten from string. I suggest trying to send a single sample, with a fixed/known size, as mentioned previously by others, and verify you can still read it correctly at your desired baud rate. If you can in fact read that data correctly, you are not reading your data fast enough. Hope this helps.

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 15 of 16
(811 Views)

Please check that your hardware connection is proper using NI MAX by doing the following steps:
After opening NI MAX choose "device and interface" then select the port you connect your hardware to it, from port setting tab press validate.

If your connection is well you will pass that test then try to run your code, if not check your hardware then try the previous steps again.

0 Kudos
Message 16 of 16
(654 Views)