05-27-2010 06:34 AM
Hi All,
I have a doubt related to VISA - viwrite().
I am controlling a DC power supply through VISA. I am able to do all the basic operations successfully without any issues.
My concern is :
when i am trying to write some invalid command , say for example "^&$" using viwrite(), it is not throwing any error.viwrite() is returning 0. After viwrite(), i called viread(), then surprisingly in read buffer i got device identification string. Even viread() is also not throwing error.
Then in this case, how i can provide error checking like the command given is an invalid command like that.
Am i missing any thing?
Any small help will be greatly appreciated. and i am using labwindows/CVI 8.5.
Thanks,
Harika.
05-27-2010 07:07 AM
05-27-2010 07:38 AM
Hi Knutson,
Thanks for your reply.
As you said, i tried with error query but then also it is not returning any error.
This is my code:
st = viOpenDefaultRM(&vi1);
st = viOpen(vi1,"Dev2", VI_NULL, VI_NULL, &vi2);
st = viWrite(vi2,cmd,strlen(cmd),&returncount);
st = viWrite(vi2,"SYST:ERR?",10,&returncount);
st = viRead(vi2,value,512,&readCount);
st = viClose(vi1);
After executing this, "value" variable contains "0,No Error".
Can you please let me know am i missing anything.
Thanks,
Harika
05-27-2010 07:39 AM
05-27-2010 07:44 AM
05-27-2010 10:04 PM
I am using Sorenson DC Power Supply.
Model is Sorensen DLM 40-15.
Is this issue woth the vendor?
05-28-2010 09:35 AM
06-01-2010 03:27 AM
06-03-2010 07:38 PM