!IN#n                Set event when digital input #n goes low or high

Syntax                        

!IN#n 0

! if Input#n is 0

!IN#n 1

! if Input#n is 1

 

Operandsn: input line number (0<=n<=39)

PlaceTMLOnline

Binary code

DescriptionSets the event condition when the digital input #n becomes 0, respectively 1. The condition of the input #n is tested at each slow loop sampling period. After you have programmed an event, you can do the following actions:
Change the motion mode and/or the parameters when the event occurs, with command UPD!
Stop the motion when the event occurs, with command STOP!
Wait for the programmed event to occur, with command WAIT!

The programmed event is automatically erased when the event occurs or if the timeout for the WAIT! command expires.

Remark: After setting UPD! or STOP! you need to wait until the programmed event occurs using WAIT!, otherwise, the program will continue with the next instructions that may override the event monitoring.

ExecutionActivates monitoring of the event when the digital input #n becomes 0 (!IN#n 0), respectively 1 (!IN#n 1). This operation erases a previous programmed event that has occurred.

 

Example                

// Start motion when digital input #36 is high

!IN#36 1; // set event when input #36 is high

//Position profile. Position feedback: 500-lines encoder

CACC = 0.3183;//acceleration rate = 1000[rad/s^2]

CSPD = 100;//slew speed = 3000[rpm]

CPOS = 20000;//position command = 10[rot]

CPA; //position command is absolute

MODE PP;

TUM1; //set Target Update Mode 1

UPD!; //execute on event

WAIT!;//Wait until the event occurs