Author Topic: Transmit CAN with Encode 8  (Read 1362 times)

Offline LouisGroen

  • PLUS+1 Developer
  • ***
  • Posts: 20
  • Karma: +1/-0
Transmit CAN with Encode 8
« 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
Mechanical Engineer
Bird Machines (Pty) Ltd

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 197
  • Karma: +4/-0
Re: Transmit CAN with Encode 8
« Reply #1 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

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 197
  • Karma: +4/-0
Re: Transmit CAN with Encode 8
« Reply #2 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

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 268
  • Karma: +20/-0
Re: Transmit CAN with Encode 8
« Reply #3 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.
Mechanical Engineer
Hydra-Power Systems - Distributor - Pacific Northwest

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 268
  • Karma: +20/-0
Re: Transmit CAN with Encode 8
« Reply #4 on: December 03, 2020, 05:32:35 PM »
Also, I've attached to this post the CAN Rx compliance block.
Mechanical Engineer
Hydra-Power Systems - Distributor - Pacific Northwest

Offline LouisGroen

  • PLUS+1 Developer
  • ***
  • Posts: 20
  • Karma: +1/-0
Re: Transmit CAN with Encode 8
« Reply #5 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,
Mechanical Engineer
Bird Machines (Pty) Ltd

Offline Mike

  • PLUS+1 Developer
  • ***
  • Posts: 35
  • Karma: +1/-0
Re: Transmit CAN with Encode 8
« Reply #6 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.

Offline Marbek_Elektronik

  • PLUS+1 Guru
  • *****
  • Posts: 315
  • Karma: +7/-0
    • Marbek Elektronik
Re: Transmit CAN with Encode 8
« Reply #7 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.
Marbek Elektronik, Dipl.-Ing. Bernd Konrad
Dienstleistung, Entwicklung, Herstellung

Offline Mike

  • PLUS+1 Developer
  • ***
  • Posts: 35
  • Karma: +1/-0
Re: Transmit CAN with Encode 8
« Reply #8 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.

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 268
  • Karma: +20/-0
Re: Transmit CAN with Encode 8
« Reply #9 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.
Mechanical Engineer
Hydra-Power Systems - Distributor - Pacific Northwest

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 268
  • Karma: +20/-0
Re: Transmit CAN with Encode 8
« Reply #10 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.
Mechanical Engineer
Hydra-Power Systems - Distributor - Pacific Northwest