LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What's the function for VISA WRITE in CVI?

Hi all,

  I am porting the labview vi to CVI. I have an external device which is connecting to the computer with GPIB and in the labview, I use VISA WRITE (the icon contains VISA abc) to send the command to control the external device. In the CVI, I didn't find any example about VISA, so what command should be used to replace VISA abc WRITE in labview vi code? How do I specified the device address? I appreciate it if there is any example for reference.

0 Kudos
Message 1 of 6
(5,312 Views)

In CVI, you will find the VISA commands via the menu Library / VISA (provided you have VISA installed). A brief introduction can be found here

 

The first command probably will be to open the resource manager

 

status = viOpenDefaultRM ( &resource_manager_handle )

 

then to open the port

 

status = viOpen ( resource_manager_handle, port_descriptor, VI_EXCLUSIVE_LOCK, timeoutvalue, &session_handle );

A typical write command looks like

 

status = viWrite ( session_handle, buffer, count, return_count )

 

Hope this will help getting you started.

0 Kudos
Message 2 of 6
(5,310 Views)

@Wolfgang wrote:

In CVI, you will find the VISA commands via the menu Library / VISA (provided you have VISA installed). A brief introduction can be found here

 

The first command probably will be to open the resource manager

 

status = viOpenDefaultRM ( &resource_manager_handle )

 

then to open the port

 

status = viOpen ( resource_manager_handle, port_descriptor, VI_EXCLUSIVE_LOCK, timeoutvalue, &session_handle );

A typical write command looks like

 

status = viWrite ( session_handle, buffer, count, return_count )

 

Hope this will help getting you started.


Thanks. But I don't know how to create the resource_manager_handle, is there any example to show how to use that? In the labview code, I only have to specify the address like GBIP0:xxx:yyyy 😞

0 Kudos
Message 3 of 6
(5,293 Views)

You create the resource_manager_handle the way I told you, by calling  viOpenDefaultRM ( &resource_manager_handle ) Smiley Wink

 

If you are looking for explanations and examples, the help manual may be useful, too.

0 Kudos
Message 4 of 6
(5,291 Views)

@Wolfgang wrote:

You create the resource_manager_handle the way I told you, by calling  viOpenDefaultRM ( &resource_manager_handle ) Smiley Wink

 

If you are looking for explanations and examples, the help manual may be useful, too.


oh, so you mean &resource_manager_handle is the handle returned by viOpenDefaultRM? I thought I have to create that first and pass that to the function. Sorry, I didn't understand the meaning of '&' before I read this reply. I just google it 😉

0 Kudos
Message 5 of 6
(5,283 Views)

Well, CVI is an integrated environment of libraries, editor, etc. but the C in CVI means that it is based on the language C Smiley Wink 

So instead of googling for the ampersand you may read a book about C... in the long term it will not work without it

 

One (of several) internet sites about C is http://www2.its.strath.ac.uk/courses/c/

0 Kudos
Message 6 of 6
(5,273 Views)