Hey my name is Kylian,
“I’m on my last year for a national higher diploma, working on my final project. I’m pretty new to industrial programming and hardware, so I’m having trouble getting it done and the deadline is approaching menacingly. Currently, I am trying to make an X90 and a 4PPC communicate via J1939 CAN bus, but I really can’t get it working properly despite all the documentation. I know Automation Studio is set up properly since I could push some visuals on the 6PFT50 piloting the X90. There is some code left from last year’s students, but I really can’t understand it and it doesn’t seem to emit anything. When reading the CAN bus, nothing pops up.”
Thanks in advance, Kylian.
Here is the code left
//Send Data
PROGRAM _INIT
// Initialisation des variables
FOR i:= 0 TO 13 DO
ArCanSenderMotor[i].DeviceName := 'IF7';
ArCanSenderMotor[i].Enable := TRUE;
ArCanSenderMotor[i].SendFrame := TRUE;
END_FOR;
FOR j:= 0 TO 2 DO
ArCanSenderSPU[j].DeviceName := 'IF7';
ArCanSenderSPU[j].Enable := TRUE;
ArCanSenderSPU[j].SendFrame := TRUE;
END_FOR;
END_PROGRAM
// Programme
PROGRAM _CYCLIC
FOR i:= 0 TO 13 DO
ArCanSenderMotor[i].Frame := Motor_0x00[i].Frame;
ArCanSenderMotor[i]();
END_FOR;
FOR j:= 0 TO 2 DO
ArCanSenderSPU[j].Frame := SPU_0x21[j].Frame;
ArCanSenderSPU[j]();
END_FOR;
END_PROGRAM
//Receive Data
PROGRAM _INIT
ArCanReceiver[0].ID := 16#18FF2017;
ArCanReceiver[1].ID := 16#18FEDA17;
ArCanReceiver[2].ID := 16#18FEEB17;
ArCanReceiver[3].ID := 16#18FEFC17;
ArCanReceiver[4].ID := 16#18FF1017;
ArCanReceiver[5].ID := 16#18E00017;
FOR k:= 0 TO 5 DO
ArCanReceiver[k].DeviceName := 'IF7';
ArCanReceiver[k].Enable := TRUE;
ArCanReceiver[k].Format := arCAN_29BIT;
ArCanReceiver[k].IDMask := arCAN_RECEIVE_SINGLE_ID;
ArCanReceiver[k].QueueSize := 128;
END_FOR;
END_PROGRAM
PROGRAM _CYCLIC
FOR k:=0 TO 5 DO
ArCanReceiver[k]();
HMI_0x17[k].Frame := ArCanReceiver[k].ReceivedFrame;
END_FOR;
END_PROGRAM
