Send a single message in a loop

I’m looking for an example of how to schedule a message to be sent in a 1s loop. I tried the following. I don’t get an error, but I also don’t get many messages on the CAN bus.

iStatus = canSchedulerOpen( pCanControllers->hBoardHandle, CAN1, &phCanChn );

iStatus = canSchedulerGetCaps( phCanChn, &pCanCaps );

ucPacketSize = 8;
pMessage.wCycleTime = (pCanCaps.dwCmsDivisor / pCanCaps.dwCanClkFreq) * 1;
pMessage.bIncrMode = CAN_CTXMSG_INC_NO;
pMessage.bByteIndex = 0;
pMessage.dwMsgId = 0x243;
pMessage.uMsgInfo.Bytes.bType = CAN_MSGTYPE_DATA;
pMessage.uMsgInfo.Bytes.bFlags = CAN_MAKE_MSGFLAGS(ucPacketSize,0,0,0,0);
pMessage.uMsgInfo.Bits.srr = 0; //dont rx the tx
pMessage.uMsgInfo.Bits.ext = 0; //Standard
pMessage.uMsgInfo.Bits.edl = 0;
pMessage.uMsgInfo.Bits.fdr = 0;
pMessage.uMsgInfo.Bits.dlc = ucPacketSize;

pMessage.abData[0] = 0x40;
pMessage.abData[1] = 0x01;
pMessage.abData[2] = 0x00;
pMessage.abData[3] = 0x00;
pMessage.abData[4] = 0x00;
pMessage.abData[5] = 0x00;
pMessage.abData[6] = 0x00;
pMessage.abData[7] = 0x00;

iStatus = canSchedulerAddMessage( phCanChn, &pMessage, &pdwIndex );

iStatus = canSchedulerStartMessage( phCanChn, pdwIndex, 0 );

iStatus = canSchedulerActivate( phCanChn, TRUE );

Sleep(1000);
iStatus = canSchedulerStopMessage( phCanChn, pdwIndex );
iStatus = canSchedulerClose( phCanChn );

Which Ixxat product are you using and what what program are you trying to create a schedule with?

Using VCI4 with a USB to CANFD device. I am using the c API. I need to create a program that can send messages in a loop. One message is the same while the other message has a counter with a CRC of the message. So, I want to schedule the message that is the same. I don’t think I can schedule a message that requires a CRC. This will run as a service on the PC. I will send messages to the service to start and stop the messages.

Hi,

I am not able to find a similar example. If you create a ticket in are support system we can try asking the Ixxat team if they have any.
https://support.hms-networks.com

We added a scheduler access demo to the existing CanCon2 demo (see attached).
There it is shown how to calculate the ticks per millisecond and the max. possible cycle time.
VciV4_Scheduler_Demo.zip (33.0 KB)