ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB one byte control

I have to control an old instrument with a serie of bytes, in binary format, one at a time.

Whatever I use, (VISA or GPIB 488), there are sent two bytes at a time, instead of one.

Why is that ? How do I prevent that ?  

0 Kudos
Message 1 of 7
(4,385 Views)
Publish your vi and we have a look at it
greetings from the Netherlands
0 Kudos
Message 2 of 7
(4,372 Views)
Hello Albert, here is my vi.ADT222B_test_contrd.png
0 Kudos
Message 3 of 7
(4,353 Views)

In the future, please post your VI rather than a screenshot. You can't debug a screenshot.

 

Your use of Format Into String is incorrect.  If you need to send out the bytes one at a time like that then you should be using the Type Cast function:

 

You should also use VISA unless you have a good reason to use the lower-level GPIB functions. 

Message Edited by smercurio_fc on 03-24-2010 09:03 AM
0 Kudos
Message 4 of 7
(4,337 Views)

Or even better use the conversion function "byte array to string", assuming you have a u8 array.

 

And of course never use wait until multiple ms, because it is used in most NI examples in a wrong way.

Instead use wait ms or hardware timing when needed.

 

 

greetings from the Netherlands
0 Kudos
Message 5 of 7
(4,312 Views)
The Byte Array to String won't work in this case because that will just give you a big long string of multiple bytes, and the user seems to need to send out one byte at a time, for whatever reason. You would have to snip out one character at time from the string inside the loop.
0 Kudos
Message 6 of 7
(4,311 Views)

Hi

 

You are right,

normally I use a subvi that transforms a byte into a character because we were used tp pascal it is called Char and accepts a byte as input and delivers a one character string at the output. Inside we use build array and array to string.

Nice test to see what is faster but I guess it will be the typecast.

 

 

greetings from the Netherlands
0 Kudos
Message 7 of 7
(4,308 Views)