Page 1 of 1

Real Time extraction of data

Posted: Thu 5. Aug 2021, 13:49
by Techteam
Good Afternoon

I have a supplier that has recently changed how he implements his can protocol and although I have searched I cannot find any help in the forum or help files to help me implement it in PCAN Explorer. Instead of sending information in several frames he now sends just one frame at speed that constantly refreshes with different data. In that frame he uses the first few bytes of data to identify what the data contained in the rest of the frame is.So in Receive Transmit I only ever see one set of data in one frame as it is constantly overwritten. I can trace and get all the data and If i pause the trace and hover I can read the information correctly. Is there a way to filter or set up instruments or signals dependent on the data contained in the frame and not the CAN ID

Re: Real Time extraction of data

Posted: Thu 5. Aug 2021, 14:10
by M.Heidemann
Hello,

For this purpose you can use a Multiplexer.

A Multiplexer can switch the signal interpretation for a given-frame based
on the value of a certain bitrange/byte.

Here a practical example for illustration purposes:

We’ll mostly work in the Symbol Editor (Tools -> Symbol-Editor)

We assume there are 3 devices. From which device a message/signals was sent is indicated by the Multiplexer (Byte 8),
the signal also reflects the corresponding device in its name.

In our example there are 6 2-byte long Signals in total (2 for each Multiplexer/Device):
MultiPlexer-Example_PE6_1.png
MultiPlexer-Example_PE6_1.png (2.95 KiB) Viewed 6441 times
All of these signals are sent with CAN-ID 0x100h, to have the multiplexer
switch between interpretations, we’ll have to add Multiplexers to our Symbol for 0x100h (right click your Symbol in the Symbol-Editor):
MultiPlexer-Example_PE6_2.png
MultiPlexer-Example_PE6_2.png (7.36 KiB) Viewed 6441 times

You can then name your multiplexer, define the multiplexer-range (Start Bit , Length), Data Length (Will only trigger for messages with that data length, if unnecessary “valid for all data lengths” can be checked) and the value for this particular Multiplexer to be triggered:
MultiPlexer-Example_PE6_3.png
MultiPlexer-Example_PE6_3.png (13.18 KiB) Viewed 6441 times
Repeat the steps for all possible Multiplexer values known:
MultiPlexer-Example_PE6_4.png
MultiPlexer-Example_PE6_4.png (8.3 KiB) Viewed 6441 times
Afterwards you can assign your signals to the Multiplexer (Right click Multiplexer in the Symbol Editor):
MultiPlexer-Example_PE6_5.png
MultiPlexer-Example_PE6_5.png (71.47 KiB) Viewed 6441 times


Once fully configured, be sure to save your symbol file and make sure the symbol file is
assigned to your current connection, the Multiplexer will now trigger depending on the value for byte8 of 0x100h:

Here a demonstration on how the Multiplexer will switch the symbolic interpretation:
MultiPlexer-Example_PE6_6.png
MultiPlexer-Example_PE6_6.png (21.11 KiB) Viewed 6441 times
This example is quite uniform, the workflow of adding Multiplexers however also applies to multiplexers in which the symbolic interpretation varies drastically.

For further questions feel free to contact me again.

Best Regards

Re: Real Time extraction of data

Posted: Thu 5. Aug 2021, 18:42
by Techteam
Many thanks for the prompt reply

Re: Real Time extraction of data

Posted: Fri 6. Aug 2021, 12:36
by Techteam
So that sort of fixed my problem. Until they added a second byte of data as a further identifier. So they have a Frame ID 100h the first byte is an ID from 0-5 which I can multiplex as you suggested, but, then for certain ID's they add a second byte 1 or 2 to substring the info so when I multiplex I only ever get the 2 substring value returned.

so I have this 100h 00 01 a string of "123456"
100h 00 02 a string of "789101112"
But the multiplex only ever returns "789101112"

The of course ID 1-5 also have a substring of 1 or 2 so I cannot set the multiplex to the second byte.

Is there any way to further delineate the multiplex ?

Re: Real Time extraction of data

Posted: Fri 6. Aug 2021, 12:53
by M.Heidemann
Hello,

PCAN-Explorer does not supports multiple Multiplexer ranges.

Are you sure these are Multiplexers (As in they change the whole interpretation of the message)?

Or are you refering to enums?

These would encode different string depending on the value ("0x01h = "Start" , 0x02h = "Stop")

Please report back to us regarding this.

Best Regards

Marvin

Re: Real Time extraction of data

Posted: Fri 6. Aug 2021, 13:16
by Techteam
Hi Marvin

I already use ENUMS for fixed data in the frame. No they use it as a way of reporting serial numbers or part numbers which obviously change from unit to unit. They used to send everything in its own frame but now just the one frame which constantly changes the signal within the frame identifying which signal with the first then the second byte. I get it to work fine using ENUMS which is what I originally did and on a trace that works okay as you see all the data but in real time I only ever see the last transmission. So say they send alarms in frame 100h and several alarms occur at once I only ever see the last alarm as each alarm overwrites the display. Or in the case of the Part or Serial Numbers just the last string.

Re: Real Time extraction of data

Posted: Fri 6. Aug 2021, 13:34
by M.Heidemann
Hello,

This is the behavior of the Receive/Transmit Window, the current value is represented.
A histroical Live-View is not available.

For applications such as your the Trace-Feature is the right choice.

For further questions feel free to contact me again.

Best Regards

Marvin