Results 1 to 5 of 5

Thread: J1939 and CANx_RECEIVE conflict

  1. #1
    Join Date
    Feb 2010
    Posts
    29

    Default J1939 and CANx_RECEIVE conflict

    Codesys Version: 2.3.9.6
    ifm_CR0020_V040005.lib
    ifm_J1939_V040005.lib

    When using the CAN2_RECEIVE block with the J1939 library, no messages are registered by the CAN2_RECEIVE function block:
    Code:
           can2_ini (
    		enable:=enable ,
    		start:=init ,
    		extended_mode:= true,
    		baudrate:= 250);
    
    	j1939(
    		enable:=enable ,
    		start:=init ,
    		my_address:=16#54 );
    
    	J1939_Receive_PercentLoad(   (*Works*)
    		ENABLE:=ENABLE ,
    		CONFIG:=INIT ,
    		PG:=0 ,
    		PF:=16#F0 ,
    		PS:=16#03 ,
    		DST:=ADR(ID_F003) ,
    		RPT:=T#0s ,
    		LIFE:=3 );
    
    	CAN2_RECEIVE_PF100(  (*Doesn't Work*)
    		CONFIG:=INIT,
    		CLEAR:=FALSE ,
    		ID:=IDRx_PF100 ,
    		DATA=> ,
    		DLC=> ,
    		RTR=> ,
    		AVAILABLE=> ,
    		OVERFLOW=> );
    When the J1939 init function block is removed, the CAN2_RECEIVE block works as intended, but the J1939_Receive function block does not work:
    Code:
             can2_ini (
    		enable:=enable ,
    		start:=init ,
    		extended_mode:= true,
    		baudrate:= 250);
    
    	J1939_Receive_PercentLoad(   (*Doesnt Work*)
    		ENABLE:=ENABLE ,
    		CONFIG:=INIT ,
    		PG:=0 ,
    		PF:=16#F0 ,
    		PS:=16#03 ,
    		DST:=ADR(ID_F003) ,
    		RPT:=T#0s ,
    		LIFE:=3 );
    
    	CAN2_RECEIVE_PF100(  (*Works*)
    		CONFIG:=INIT,
    		CLEAR:=FALSE ,
    		ID:=IDRx_PF100 ,
    		DATA=> ,
    		DLC=> ,
    		RTR=> ,
    		AVAILABLE=> ,
    		OVERFLOW=> );
    Is there a way to make both the J1939_RECEIVE block and the CAN2_RECEIVE work together?

  2. #2
    Join Date
    May 2009
    Location
    Minneapolis, MN
    Posts
    299

    Default

    I believe its a limitation of the version of software that you are using. I just tested this with the V050003 software and it does work.

  3. #3
    Join Date
    Feb 2010
    Posts
    29

    Default

    I updated to software version CR0020 50003 and J1939 50001

    CAN2_RECEIVE does receive some messages along with the J1939 block, but not all of them. It appears to drop all messages in the buffer, and only receives one message with a given identifier.

    For example, if i receive 5x messages with a given identifier between this program scan and the next, CAN2_RECEIVE will generally yield an available of 1 message, and it will only be the first of those 5 messages so long as the J1939 function block is implemented. Occasionally the second message will slip through, but unreliably.

    Other identifiers will also be able to be read, but with the same restriction as described above.

  4. #4
    Join Date
    May 2009
    Location
    Minneapolis, MN
    Posts
    299

    Default

    You will get some missing I have seen this same reaction. I am not sure why you would run both to the same identifier. I do have programs running both CAN2_Receives and J1939_Recieves but not both to the same identifier.

  5. #5
    Join Date
    Feb 2010
    Posts
    29

    Default

    I do not run a J1939_RECEIVE and a CAN2_RECEIVE to the same identifier, merely having the J1939 function block in the program with any identifier causes the issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •