Controlling RS232 (Keithley 2000) via IGOR
DrRaik
Does anybody of you have an idea about the compatibility of the VDT on XP and Win 7.
Attached a snippet of the code using the VDT:
The waste time part is just a workaround to assure, that the Keithley accept the command.
CMD= "VDTClosePort COM7"
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \"*CLS\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \"*RST\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD= "VDTWrite/O=5/Q \":TRAC:FEED:CONT NEV\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD= "VDTWrite/O=5/Q \":ROUT:OPEN:ALL\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \":ROUT:CLOS (@\"+num2str(Channel)+\")\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \"READ?\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste)
CMD="VDTRead/O=5/Q Value"
Execute CMD
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \"*CLS\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \"*RST\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD= "VDTWrite/O=5/Q \":TRAC:FEED:CONT NEV\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD= "VDTWrite/O=5/Q \":ROUT:OPEN:ALL\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \":ROUT:CLOS (@\"+num2str(Channel)+\")\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste2)
CMD="VDTWrite/O=5/Q \"READ?\""
Execute CMD
T0=ticks
do
//Waste the time
while(ticks<T0+Waste)
CMD="VDTRead/O=5/Q Value"
Execute CMD
I know that I and many other people have successfully used VDT and the newer VDT2 on Windows XP.
If you can find the crash log it might provide a clue. For details execute:
Also what version of Igor are you using? Try updating to the latest.
Also you might consider converting your code to VDT2 which does not require using Execute. For details:
March 26, 2013 at 07:05 am - Permalink
Actually I have exchanged the OS of the measurement computer to Win 7 and no crash occurs...strange. Maybe it is depended to the internal drivers of the RS232 and the problem is not IGOR related. Such an effect I never revealed during my time with IGOR.
Do you have a 'smarter' idea for waiting than my waste time algorithm? I have tried to read the V_VDT status, but it won't work, because I require a waiting until finished...on the COM ports.
Thanks a lot
Raik
March 26, 2013 at 09:53 am - Permalink
The
Sleep
operation is a possibility but the only practical difference is that it avoids hogging the processor. Other than that there's nothing that comes to mind right now.I have no experience working with this instrument, but many instruments will send a reply to acknowledge successful receipt or execution of a command. In that case you can use
VDTRead2
and have it block until a response is received, which tells you that the event of interest has occurred. But whether this is possible depends on the particulars of your instrument and the specifics of what you're trying to do.March 26, 2013 at 11:55 am - Permalink
March 26, 2013 at 12:08 pm - Permalink