LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling TTi PL330DP GPIB/Serial power supply using serial

Hello All
           I have a Thurlby Thandar Instruments PL330DP dual programmable power supply with a GPIB and serial connector on the rear of the unit.
 
I have labview experience but this is the first GPIB device I have used.
 
I need to drive the power supply using the serial cable from the PC. I have downloaded an instrument LLB from here:
 
the code is opposite the text:
 PL-P series Power Supplies, LabView Driver
 
The problem as I understand it is the code is designed to run using a GPIB interface and I dont understand how the code needs changing/adapting to run from the serial port.
 
I tried running the example serial port vi which sends a *IDN?. I also tried the same using the VISA session from MAX, but there is no responce. I have tried a couple of units now, (the other is a TTI TSX3510P). The first unit i tried has a number of dip switches which I set up hopefully correctly.
 
I also tested the pins on the serial cable. 2 - 2 , 3 - 3 , 5 - 5.
 
The potential problems that I think could be causing the problem are:
dip switch settings or internal settings must be right but am unsure if GPIB::1 references dipswitch 1 = on
 
serial port needs setting up if code is configured for PC PCI GPIB card
 
Advice appreciated.
 
Regards Chris
 
 
0 Kudos
Message 1 of 4
(7,376 Views)
First, your serial cable is wired straight through. This is a bit unusual. Most instruments require a null-modem cable where the tx and rx lines are swapped. If your manual instructs you to use a straight cable though, that's not the problem. You should not try to use the driver until you can get communication to work in either MAX or Hyperterminal. If using MAX, be sure to send a \r\n at the end of each command. The GPIB driver appends this (CR/LF) and I would assume that the serial requires this as well. Make sure that the pc's serial port is set to exactly what the instrument's is. I couldn't find an on-line programming manual so if you have one and can post it, it would help a lot.
 
Once you've communicated with the instrument, you can tackle changing the driver to handle serial. There isn't a lot that you would have to change since the driver is using VISA. You would probably need to add some additional code to configure the serial port in the initialize function. You can look at the shipping HP34401 driver to see how it's done. I suspect that you will have to change the termination character. You'll also need to replace the Old VISA Open in the initialize function with the normal VISA Open on the Instrument I/O>VISA>VISA Advanced palette.
0 Kudos
Message 2 of 4
(7,370 Views)

Hello Dennis,
 Sorry for the delay, Thankyou for the advice. I managed to obtain a manual, please find attached.

I agree, the cable should be wired 2 - 3 and 3 - 2, I spotted this in the manual.

I retried the various labview routines sending *IDN?\n and the GPIB driver for the device and while I dont get the errors I previously saw  I cant get any thing returned.

Specifically. The labview example 'basic serial write & read.vi' returns:

Warning 1073676294 occurred at VISA Read in Basic Serial Write and Read.vi

Possible reason(s):

VISA:  (Hex 0x3FFF0006) The number of bytes transferred is equal to the requested input count. More data might be available.

So it looks as though I am stuck at receiveing a returned message from the power supply using the simple serial vi.

Regards

Chris

0 Kudos
Message 3 of 4
(7,356 Views)

When you got that warning, how many bytes did you request? That warning just means that the read terminated after reading the number of bytes specified and not when a termination character was detected. Did you actually try sending commands in Hyperterminal like I suggested? The other thing to check is to see whether the instrument is in the ARC mode as desribed in the manual. This is a multi-drop serial mode and the instrument has to be specifically addressed to talk/listen.

0 Kudos
Message 4 of 4
(7,348 Views)