LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem calling IviDCPwr_init()

Hi Jason,

Is there a reason you are using viPrintf rather than a simple viWrite? Also, an NI Spy capture of the program running could be useful. I'm not quite sure what you mean when you say that certain commands don't work, and an NI Spy capture could provide more information.

john m
0 Kudos
Message 11 of 14
(1,354 Views)
I used viPrintf() to make the code shorter (only one line instead of several if using viWrite()). But just before changing my code to use viWrite(), I realized for those commands I thought not working, I didn't include the '\n' at the end. Eg, I did
status = viPrintf(gAgn5768, "*RST");
instead of
status = viPrintf(gAgn5768, "*RST\n");

So till now, everything is working fine with me. Thank you so much. I love NI.

Jason
0 Kudos
Message 12 of 14
(1,353 Views)
Change the VI_ATTR_WR_BUF_OPER_MODE attribute as shown below, immediately after calling viOpen(). This ensures each viPrintf() call sends the given command to the instrument. As for GPIB then, no need to add \n character if the instrument accepts EOI signal as the terminator.

status = viSetAttribute( inst, VI_ATTR_WR_BUF_OPER_MODE, VI_FLUSH_ON_ACCESS);
0 Kudos
Message 13 of 14
(1,344 Views)

Additionally saying,

A "\n" is not always required to add for GPIB and USB INSTR devices.  But an explicit "\n" addition is still required for ASRL INSTR devices, because serial interfaces do not have EOI or EOM termination.

0 Kudos
Message 14 of 14
(1,290 Views)