07-16-2018 09:31 AM
case EVENT_COMMIT: // a button event
/* Begin by initializing the system*/
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
{
/* Error Initializing VISA...exiting*/
return -1;
}
/* Open communication with Serial Port 1*/
/* NOTE: For simplicity, we will not show error checking*/
status = viOpen(defaultRM, "ASRL5::INSTR", VI_NULL, VI_NULL, &instr);
/* Set the timeout for message-based communication*/
status = viSetAttribute(instr, VI_ATTR_TMO_VALUE, 5000);
/* Lock the serial port so that nothing else can use it*/
status = viLock(instr, VI_EXCLUSIVE_LOCK, 5000, VI_NULL, VI_NULL);
/* Set serial port settings as needed*/
/* Defaults = 9600 Baud, no parity, 8 data bits, 1 stop bit*/
status = viSetAttribute(instr, VI_ATTR_ASRL_BAUD, 9600);
status = viSetAttribute(instr, VI_ATTR_ASRL_DATA_BITS, 7);
/* Set this attribute for binary transfers, skip it for this text example */
/* status = viSetAttribute(instr, VI_ATTR_ASRL_END_IN, 0); */
/* Ask the device for identification */
status = viWrite(instr, "*IDN?\n", 6, &retCount);
status = viRead(instr, buffer, MAX_CNT, &retCount);
/* Unlock the serial port before ending the program*/
status = viUnlock(instr);
/* Your code should process the data*/
/* Close down the system */
printf("%s",buffer);
status = viClose(instr);
status = viClose(defaultRM);
Please help correct my mistakes. i just want to get the Status "OK" from power supply . I tried with Hyper terminal and works fine
07-19-2018 05:29 AM - edited 07-19-2018 05:32 AM
Hi
Attached Instr driver that works for me for 10 years
pay attention to the following:
1. the zup is configured to RS232
2.The zup address & boaud rate is configured to what you send in the init function
3.Set Z+ compitability to "OLD" zup communications
Best of luck
Gabel Daniel
07-19-2018 11:49 AM
thanks for helping 🙂 but i have one doubt which is about selecting "OLD".There seems to be no option mentioned in the manual they have provided. I use a 36-6 Z+ series PS
07-21-2018 09:16 AM
Hey thanks again. i didn't needed any extra drivers we just tried connecting with USB and the pxi system detected it as a Z+ COM port and a CR character at end of commands did the trick.