PLUS+1 User Forum

PLUS+1 Tools => PLUS+1 GUIDE => Topic started by: LouisGroen on December 03, 2020, 04:21:51 PM

Title: Transmit CAN with Encode 8
Post by: LouisGroen on December 03, 2020, 04:21:51 PM
Hi everyone

I am busy with a project that requires, amongst other things, me transmitting a bunch of Boolean signals from a DP570 display to the main controller via CAN.

I have read most of the posts I could find to assist with transmitting CAN data as I am still new at this, but I cant get the application to compile.

*** ERROR 98 *** [CHPARGU2] INVALID MIX OF INPUT AND OUTPUT TYPES FOR COMPONENT: {Encode 8}
Position: module=DP570-01-00-00-00-00-XXT page=TOP!Application!DISPLAY_INPUTS x=2125000 y=1400000


*** ERROR 22 *** [CHPARGU2] ILLEGAL TYPE: {U8} ON COMPONENT: {Transmit CAN}, ENTRY A{2}
Position: module=DP570-01-00-00-00-00-XXT page=TOP!Application!DISPLAY_INPUTS x=2700000 y=2250000


Does anyone have an example of transmitting more than 8 boolean inputs over CAN?

I have attached my code if anyone can perhaps spot the issue?

Thanks
Title: Re: Transmit CAN with Encode 8
Post by: pinias on December 03, 2020, 04:43:36 PM
you can Encode boolean signal but U8,

your problem is the Encode block with U8 inputs

regards
Title: Re: Transmit CAN with Encode 8
Post by: pinias on December 03, 2020, 04:52:22 PM
after encoding you need to create an array 8, type U8, and that will go to the CAN data input, that should be all

regards
Title: Re: Transmit CAN with Encode 8
Post by: FluidPowerTom on December 03, 2020, 05:31:43 PM
There used to be a CAN Tx compliance block that handled a lot of that for you, but the developers (in their great wisdom) discontinued it.  I usually send it to my new customers.  I have attached it here.

As stated by the others you are having data type issues.  You need to be using the array operators to create an array of eight U8's.  However, the attached compliance block handles that for you.
Title: Re: Transmit CAN with Encode 8
Post by: FluidPowerTom on December 03, 2020, 05:32:35 PM
Also, I've attached to this post the CAN Rx compliance block.
Title: Re: Transmit CAN with Encode 8
Post by: LouisGroen on December 04, 2020, 07:58:34 AM
Hi guys,

Thanks for the help! That makes a whole lot more sense now!

The function blocks clarify everything. Thanks Tom!

Regards,
Title: Re: Transmit CAN with Encode 8
Post by: Mike on December 07, 2020, 08:29:11 PM
Not sure if pinias' answer was quite clear but with your second encode if you were to query it and set the output to an array of u8 it would have worked.
Title: Re: Transmit CAN with Encode 8
Post by: Marbek_Elektronik on December 08, 2020, 10:51:19 AM
a little thing:
Is there an need for a positive transmission element in front of the send input?
Becaus, it should send 1 time everey 100ms.
Title: Re: Transmit CAN with Encode 8
Post by: Mike on December 08, 2020, 06:22:01 PM
With that particular block it should be included inside the block. The description states:
" Send (Bool):
False to true transition will send the PDO.
T: Positive transition will send the PDO
F: Do not send PDO"

But yes I believe if using the basic CAN blocks that you would have to add that transition element yourself.
Title: Re: Transmit CAN with Encode 8
Post by: FluidPowerTom on December 08, 2020, 06:22:42 PM
Good catch.  Indeed there needs to be a positive transition aka rising edge there in front of the transmit input, or it will send every scan while that's true.  The old CAN Tx compliance block I attached there does have that fortunately.
Title: Re: Transmit CAN with Encode 8
Post by: FluidPowerTom on December 08, 2020, 06:24:00 PM
With that particular block it should be included inside the block. The description states:
" Send (Bool):
False to true transition will send the PDO.
T: Positive transition will send the PDO
F: Do not send PDO"

But yes I believe if using the basic CAN blocks that you would have to add that transition element yourself.

Sounds like they may have built it into that compliance block then based on that description.