Hello,
I'd like to cycle through the control ports, turning on and off sequentially. However, I get an error "variable illegal in parameter: n" in the WriteIO command. Also get same error when using PortSet(n,1). Here's the logic:
Public n as long
BeginProg
n=1
Scan(1, Sec, 0, 0)
WriteIO(&B11111111,0)
if n=512 then n=1
WriteIO(n,1)
n = n*2
Nextscan
Endprog
Hi ariklee
You have put your 'n' variable in the mask parameter, try it in the source parameter and you'll find it works a lot better.
The mask parameter tells the logger which ports will be affected by the instruction and the source parameter controls the ports
Public n
BeginProg
n=1
Scan(1,Sec,0,0)
If n=256 Then n=1
WriteIO(&B11111111,n)
n = n*2
NextScan
EndProg