support for periodic/cyclic messages/frames

This forum covers issues concerning multiple software products.
Bourass
Posts: 13
Joined: Mon 28. Jan 2019, 18:31

Re: support for periodic/cyclic messages/frames

Post by Bourass » Wed 6. Feb 2019, 10:05

Hi,
You will also find timer examples in our source code examples for PCANBasic, used for CAN_Read(). You can also use those timer for CAN_Write().
i did not find any timer used for CAN_Read(), can you please show me this timer in the read function and how can i adapt it to Write function?

Thanks

K.Wagner
Software Development
Software Development
Posts: 718
Joined: Wed 22. Sep 2010, 13:36

Re: support for periodic/cyclic messages/frames

Post by K.Wagner » Wed 6. Feb 2019, 10:24

Hello,
Bourass wrote:i did not find any timer used for CAN_Read()
and how did you look for it? Each PCAN-Basic sample has implemented reading with timer, with events and manually. Everything you need is in the samples. You just need to study the code and understand it. We cannot do this for you.

For instance, here is an image of the PCAN-Basic sample project for C#:
Timer control for reading with PCAN.-Basic
Timer control for reading with PCAN.-Basic
PCAN-Basic-Timer.PNG (23.38 KiB) Viewed 1923 times
The code for it looks like:

Code: Select all

private void tmrRead_Tick(object sender, EventArgs e)
{ 
    // Checks if in the receive-queue are currently messages for read
    // 
    ReadMessages();
}
Bourass wrote:how can i adapt it to Write function?
Just create a new timer and write messages instead of reading them, in the timer function.
Best regards,
Keneth

Bourass
Posts: 13
Joined: Mon 28. Jan 2019, 18:31

Re: support for periodic/cyclic messages/frames

Post by Bourass » Wed 6. Feb 2019, 11:24

Using this timer can i send many frames periodically or not?
thanks

K.Wagner
Software Development
Software Development
Posts: 718
Joined: Wed 22. Sep 2010, 13:36

Re: support for periodic/cyclic messages/frames

Post by K.Wagner » Wed 6. Feb 2019, 11:33

yes
Best regards,
Keneth

Post Reply