Hello,
I have a question,
I'm running a R30iA controller with a r200iB robot, connected to a PLC.
The PLC is inputting 3 values for 3 different axes every Profibus cycle.
The robot has to output the set values to the PLC, the correct value fot the correct brush.
GI15 = ID of axis and GI16 = current value.
GO15 = ID of axis and GO16 = setpoint value (as in, move to this position)
so: if GI15=1 the output (GO16) must be the output for brush one, stored in the register (we use INT so we can rotate the brush minus)
GO15 and GI15 = 8 bit
GO16 and GI16 = 16bit
My BG Logic program:
IF (GI[15:gbiID]=2),JMP LBL[1] ;
IF (GI[15:gbiID]=4),JMP LBL[2] ;
IF (GI[15:gbiID]=6),JMP LBL[3] ;
JMP LBL[999] ;
;
LBL[1] ;
R[154:ActualValueAx1]=GI[16:gbiActualValue] ;
IF (R[154:ActualValueAx1]>32767),R[154:ActualValueAx1]=(R[154:ActualValueAx1]-65536) ;
GO[16:gboSetPointValue]=R[151:SetPointValueAx1] ;
IF (R[151:SetPointValueAx1]>32767),R[151:SetPointValueAx1]=(R[151:SetPointValueAx1]-65536) ;
JMP LBL[999] ;
LBL[2] ;
R[155:ActualValueAx2]=GI[16:gbiActualValue] ;
IF (R[155:ActualValueAx2]>32767),R[155:ActualValueAx2]=(R[155:ActualValueAx2]-65536) ;
GO[16:gboSetPointValue]=R[152:SetPointValueAx2] ;
IF (R[152:SetPointValueAx2]>32767),R[152:SetPointValueAx2]=(R[152:SetPointValueAx2]-65536) ;
JMP LBL[999] ;
LBL[3] ;
R[156:ActualValueAx3]=GI[16:gbiActualValue] ;
IF (R[156:ActualValueAx3]>32767),R[156:ActualValueAx3]=(R[156:ActualValueAx3]-65536) ;
GO[16:gboSetPointValue]=R[153:SetPointValueAx3] ;
IF (R[153:SetPointValueAx3]>32767),R[153:SetPointValueAx3]=(R[153:SetPointValueAx3]-65536) ;
JMP LBL[999] ;
LBL[999] ;
GO[15:gboID]=(GI[15:gbiID]) ;
But since the PLC bus cycle is faster it sometimes happens that brush 3 recieves the value for brush 1 or the other way around.
Because it's background logic I'm limited in my instruction possibility's. I can't set a wait instruction to "synchronise" the cycles.
The interface is too small to make a different GO for every brush.
Calculating the values in different registers doesn't work, seperate BG programs are no sollution. The problem is the timing.
Does anybody have a suggestion?
Thanks in advance.