error C1070


Shan

Recommended Posts

With LAbjack digital out should control a multiplexer. And the mux gives the voltage value through the analog in port. The following sequences should read and write the voltage value in the Motor1 channel only one time per period, in my case one time per minute. Motor 2,3,...etc may follow if this problem is solved.

Sequence name DigitalOut

time 0

DigitalOut = 0

time 30

DigitalOut = 1

time 60

goto(0)

Sequence name Motor1

if (DigitalOut[0] = 0)

read(Eingang0) //channel name of analog in port AI0

Motor1.AddValue(Eingang0[0])

endif

This Sequence doesn`t work. I get the error message:

C1070 not enogh parameters for the given operator:Motor1 Line 1 – Uncaught error in sequence Motor1.

Link to comment
Share on other sites

This is because you used a single = sign in your comparison. It must be ==. We may change this in the future as it catches a number of people, but for now you must use == whenever comparing values, and a = when assigning a value.

Next a few comments on your sequences:

1) Don't use Time / Goto notation. Its bad form and is only there for backward compatability. Use:

while (1)
   digitalout = 0
   delay(30)
   digitalout = 1
   delay(30)
endwhile

2) If you really want the setting of the digitals and the readings to sync up, put them in the same sequence:

while (1)
   digitalout = 0
   read(Eingang0)
   Motor1.AddValue(Eingang0[0])
   delay(30)
   digitalout = 1
   delay(30)
endwhile

3) if you are concerned about propogating time errors (i.e. loop taking slightly longer than 1 minute, use wait() instead of delay(). For those reading this and doing short loops, you have to be careful using wait(), but for your app, where the delays are long, a wait() should be fine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.