Page 1 of 1

RS232 VALCO valve control through Chemstation A.09.xx?

Posted: Tue Feb 21, 2012 5:19 pm
by alba
Dear all,

I'm trying to control a 2-positions VALCO valve via an RS232 cable and through Chemstation.

I've been trying to use the Utility included in the UCL, which has the IO.exe program and the macro IOTest.mac.

The version to send data is the one I've been trying to execute but I have problems...

I use the following commands:

!
!! IO program test macro suite; an example of using the
!! program.
!!
!! JRG 12/06/91
!!
!! Revised 13/02/93 for the HPLC ChemStations Rev A.02.00
!! Some changes introduced by me

! Output test macro
Name Out
! Define variables
local Message$, counter, Task
local Program$, Macro$, Output$, Params$
on error StopMac

Params$ = "Port=Com1 Baud=9600 Word=8 Parity=none Stop=1 Pacing=none Terminator=13+10"

Macro$ = _autopath$ + "io.mac"
Program$ = _autopath$ + "io.exe"

! Output loop
counter = 0
IO_error = 0

while IO_error = 0 do

on error IO_error = 0 ! No error if file is not there
delete Macro$,DONTASK
on error StopMac
counter = counter + 1

!Output$ = "This is output string " + val$(counter)
!!I've written the next line
Output$ = "goA"

!Task = Exec (Program$ + " " + Output$ + " File=" + Macro$ + " " + Params$)
!!I've written the next line
!!I'm not sure about how I should use the ExecNoWait command because
!!at this point all the information should be passed to the program (which I don't
!!know how it exacty works...
!! Need some help at this step, I think!
Task = ExecNoWait (Program$, , Output$ + " File=" + Macro$ + " " + Params$)


! Wait for macro file to be built

While (FileStat (MODE, Macro$) <> 1) do

sleep 1

EndWhile

IO_Error$ = " "


! Read and print status

macro Macro$,go
print "Counter = ",Counter," Message = ",IO_Error$

endwhile

return
EndMacro

!!!!!!!!!!!!!!!!

Name StopMac
print "Macro aborted."
EndMacro

Could anybody help me in sending the commands I need to control the valve via RS232?

I thank you in advance for your help.

Re: RS232 VALCO valve control through Chemstation A.09.xx?

Posted: Mon Feb 27, 2012 3:13 pm
by alba
Dear all,

I found the problem, the .exe file was read-only... Now it works.