ControlLogix
Member
Hi folks,
I am having a little trouble with a rung of code which appears at the bottom of the msg (Sorry, don't know how to paste it in here ). The tag called TmpInt is used to called a program within an Emerson servo drive. There is an offset of 4 within the Emerson setup so to call program 1, a value of 5 has to be actually sent to the Emerson. Therefore TmpInt will contain a value of 1, 4 is added to it and Emerson1.Seq.Function2 is latched.
Now TmpInt is calcualted via the 1st instruction (the CPT). Now all values for TmpInt will be in the range of -1 to 10...I know that for a fact since I worked through all possible values for all the variables. Now to my problem....
If I have a value of 1 in TmpInt after I do my CPT instruction, the LIM instruction will be true and therefore move a value of 9 into TmpInt. That now means however that program 13 will always be called regardless of the value of the calculated TmpInt...which should in theory call program 5 in my Emerson drive. Am I correct in what I am saying or is TmpInt recalulated prior to the Add instruction?
Any feedback on this would be much appreciated.
Regards,
A boggled mind!!
CPT(TmpInt,LowRamLevel-RamLowLimit)[LIM(10,TmpInt,-1)MOV(9,TmpInt)MOV(InsertionMgr.RamHighLimit,InsertionMgr.LowRamLevel),ADD(TmpInt,4,Emerson1.ProgNum)OTL(Emerson1.Seq.Function.2)];
I am having a little trouble with a rung of code which appears at the bottom of the msg (Sorry, don't know how to paste it in here ). The tag called TmpInt is used to called a program within an Emerson servo drive. There is an offset of 4 within the Emerson setup so to call program 1, a value of 5 has to be actually sent to the Emerson. Therefore TmpInt will contain a value of 1, 4 is added to it and Emerson1.Seq.Function2 is latched.
Now TmpInt is calcualted via the 1st instruction (the CPT). Now all values for TmpInt will be in the range of -1 to 10...I know that for a fact since I worked through all possible values for all the variables. Now to my problem....
If I have a value of 1 in TmpInt after I do my CPT instruction, the LIM instruction will be true and therefore move a value of 9 into TmpInt. That now means however that program 13 will always be called regardless of the value of the calculated TmpInt...which should in theory call program 5 in my Emerson drive. Am I correct in what I am saying or is TmpInt recalulated prior to the Add instruction?
Any feedback on this would be much appreciated.
Regards,
A boggled mind!!
CPT(TmpInt,LowRamLevel-RamLowLimit)[LIM(10,TmpInt,-1)MOV(9,TmpInt)MOV(InsertionMgr.RamHighLimit,InsertionMgr.LowRamLevel),ADD(TmpInt,4,Emerson1.ProgNum)OTL(Emerson1.Seq.Function.2)];