LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with "Write to text file" VI

Solved!
Go to solution

@santo_13 wrote:

@mcduff wrote:

@santo_13 wrote:

VISA being intended for Instruments, I believe it would be the manufacturer's responsibility to ensure the termination character is not part of the data or use a term char that is not part of the data.

Binary data is sometimes transmitted over VISA, e.g., a data stream from an oscilloscope. Here you can have termination characters mixed in.


In such scenarios, you tend to disable termination and read specific number of bytes given by the header.


Unless you are working with a device such as the HP (Agilent, Keysight) DDMMs that don't really work that way.  Those have no STX, Size, preamble in the message structure.  Then you tend to rely on the warning or write intermittently functional code.


"Should be" isn't "Is" -Jay
Message 11 of 17
(427 Views)

@MaSta wrote:

I think I fell for this again, because it's not the first time. Damn! You don't think of that first.

 

It's not the VI writing the text, it's the VISA Read VI that truncates the message after having received 0xA.

I didn't configure the VISA session accordingly.


I was about to say that. 0A is usually a Visa terminate character and you mentioned Modbus ... 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 17
(407 Views)

@JÞB wrote:

@santo_13 wrote:

@mcduff wrote:

@santo_13 wrote:

VISA being intended for Instruments, I believe it would be the manufacturer's responsibility to ensure the termination character is not part of the data or use a term char that is not part of the data.

Binary data is sometimes transmitted over VISA, e.g., a data stream from an oscilloscope. Here you can have termination characters mixed in.


In such scenarios, you tend to disable termination and read specific number of bytes given by the header.


Unless you are working with a device such as the HP (Agilent, Keysight) DDMMs that don't really work that way.  Those have no STX, Size, preamble in the message structure.  Then you tend to rely on the warning or write intermittently functional code.


Good to know, though weird, such devices do exist.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 13 of 17
(403 Views)
  • Good to know, though weird, such devices do exist.

Not quite weird, those and similar devices were designed before HPIB was stolen and adopted when IEEE established standard 488.

 

That physical layer has an 8 bit parallel bus and required handshaking lines. 

 

NI-VISA had to emasculate the capabilities of GPIB in the first few versions until the bus specific properties could be exposed and many device manufacturers let NI set the LabVIEW Driver Standard.  


"Should be" isn't "Is" -Jay
Message 14 of 17
(395 Views)

@santo_13 wrote:


VISA being intended for Instruments, I believe it would be the manufacturer's responsibility to ensure the termination character is not part of the data or use a term char that is not part of the data.

Uhm, what? Data is data. And what is the definition of an instrument? Can be any device that is able to receive data of any form. The only logic can be "use termination only when explicitly enabled while the default is not enabled". Well, I learn new "weird stuff" almost every time I use LabVIEW and I use for quite a while now. 

0 Kudos
Message 15 of 17
(362 Views)

Yes, right. A ModBus message with binary bytes, received by VISA Read via an Ethernet interface. It was terminated at 0xA. Terminated until I switched off a serial setting while using an Ethernet interface...

Message 16 of 17
(360 Views)

@MaSta wrote:

Yes, right. A ModBus message with binary bytes, received by VISA Read via an Ethernet interface. It was terminated at 0xA. Terminated until I switched off a serial setting while using an Ethernet interface...


Makes perfect sense! 😄

(I guess you should see it as using a Serial Protocol over Ethernet)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 17 of 17
(335 Views)