Hi all,
I have made a cicode file to input lines of data into our system upon the press of a single button on the citect screen.
I now need to simulate this citect button with a PLC input and im either missing the obvious or its beyond me as to how i can do this.
Basically, is it possible to run a cicode function from a PLC input? or can it only be done from a citect button?
My line of code is as follows:-
*****************************************
FUNCTION AddDumpRemotely()
_EnterOrdNo = _ShwOrdNum + 1;
TForm = " XXX";
_TruckType = 0;
AddOrder();
RETURN
END
*****************************************
The lines of programming after the AddDumpRemotely() function are the cicodes i want to execute.
AddDumpRemotely function is selected by the operator pressing an on-screen button, i need to be able to do what the operator does but by a PLC Input instead.
Ive added a line of programming into the PLC to allow for a remote input to be high when pressed and also added a TAG into citect for the same input and this works ok but i dont know how to get this TAG to run the FUNCTION above.
I tried to add the following to the cicode but to no avail as it either errors on compiling if i dont use a FUNCTION command.....
******************
IF dumpbyremote=1 (which is my TAG)
THEN _EnterOrdNo = _ShwOrdNum + 1;
TForm = " XXX";
_TruckType = 0;
AddOrder();
RETURN
END
******************
or it compiles but doesnt do anything if i put it after the FUNCTION command as it still needs the operator to press the on screen button for the PLC input to run the cicode....
******************
FUNCTION AddDumpRemotely()
IF dumpbyremote=1 (which is my TAG)
THEN _EnterOrdNo = _ShwOrdNum + 1;
TForm = " XXX";
_TruckType = 0;
AddOrder();
RETURN
END
******************
All i need is for the remote input to run the cicode without the intervention of the operator pressing the on screen button.
Please help as i feel this is just something im overlooking.
Im using an OLD Citect version 5.3 with an AB 5/05 PLC.
Thanks in advance.