Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

register based communication

What is the difference between register based communication and message based communication. How would the programming in NI VISA be different for these two communication methods.
0 Kudos
Message 1 of 5
(4,618 Views)
Well, they're two totally different approaches. I'll try to summarize them here, but I highly recommend you look at the NI-VISA Help file in NI-VISA 3.1(or the User Manual in older versions) and look at the sections titled Message-Based Communication and Register-Based Communication. They use different sets of methods.

In message-based programming, as in GPIB, Serial, USB, etc., you send messages (often ASCII, such as *IDN?) down a pipe. You don't worry about exactly where you're sending it - it just goes to the device. You then usually read back a response (again, often ASCII). Binary messages are possible too, but that's usually needed only for a large transfer such as a floating point waveform, where the ASCII representation might be 4-5 times as
long as the binary representation. The device has to interpret each message and convert it to access its registers internally.

With register-based programming, as in VXI or PXI, you have to know the address space (eg, in VXI, A16 or A24 or A32) and you have to know the register offset to write to. Each register address or address range often has unique functionality. It's like writing a device driver and hitting the registers directly. It's lower-level and potentially higher speed, but it's also more bus-specific.

The question of performance really depends where the bottleneck is. Which is faster - the speed of the bus you're using between the PC's CPU and the device, or is it the device's CPU and/or internal bus itself? If the bus is slow, you want to transfer as little data as necessary and have the device do as much as possible, and vice versa.

I hope this makes sense.

Dan Mondrik
National Instruments
Message 2 of 5
(4,620 Views)

Hi Dan,

Can you do a combination of both? We have an instrument that we can do message-based to acquire data; however, to do other tasks such as monitoring laser intensity, it can only be done through register-based programming.

Thanks for your response.

Otman

0 Kudos
Message 3 of 5
(4,303 Views)

Hi Otman,

Both register and message-based communication methods are using the same resource and will not run simultaneously.  Only one resource can be open for a single device at a time.  The session for the instrument will need to be opened then closed for each communication method before the other communication method is allowed to talk to the instrument. 

Regards,

Andy L.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(4,284 Views)
Thanks Andy. That makes lots of sense. I'll take your comments into consideration when developing my application.
0 Kudos
Message 5 of 5
(4,279 Views)