Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000 WriteIO using variable for mask


ariklee Dec 17, 2012 09:46 PM

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


iog Dec 18, 2012 06:25 PM

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

Log in or register to post/reply in the forum.