Hello petervlna,
I'm not sure if I understood correctly what the user is trying to achieve here. Let me go through some details of how our toolbox works and what blocks we have available for the FCAN.
Our toolbox generates code in one of 3 places:
- Initialization code (for configuring peripherals, clocks, pins, etc) get generated in a function that is called once, at the beginning of the application
- Main loop code - this is where the code for action blocks gets generated - so here is where you'll see calls for blocks like FCAN Send. This main loop is controlled by a timer for which you can set the period by setting the discrete step parameter of the model
- ISR code - we have many blocks that handle various events and can trigger a subsystem when those get generated. For example, in the CAN ISR you can have the block trigger a subsystem (where you can put any block you want, so you have full control) for events like Rx Complete, Tx Complete, Rx FIFO Complete, etc. Another useful example here is the PIT block - you can set up this timer to trigger periodically a subsystem of your choosing. This means you can achieve some scheduling by using this, independent of the main loop control.
To get back to the questions - you don't have enable/disable on the CAN Send block, but you can control when you start the transfer by other means - this is how it was intended to be used. The most basic approach would be to have a variable checked in the main loop, and when it gets to a certain value, you trigger a subsystem in which you put the CAN Send block. This scenario only requires a standard IF block and an IF Subsystem action block.
For the other question, if the CAN cable is disconnected, depending on the timing, 1 of 2 things would happen: either no part of the frame will get sent (if the decoupling would be done between transfers) - and in this scenario you will get no CAN messages - either only part of the frame will be sent (this is the unlikely scenario where it gets decoupled when a transfer is ongoing) - in this scenario, error frames will be generated on the bus, but this won't affect you as the hardware error counters inside the transceiver will make sure to stop the flooding of the bus. The bottom line is that you won't get any message from the receive block, as there is no valid CAN frame put on the bus. If you use the blocking mode of the receive block, you can set-up a timeout value in ms and that will make sure to stop the receiving state after a period. You can check the status with another block we have available, the CAN Transfer Status.
We have a webinar on the topic of CAN - if the user is interested, he can watch it here.
You can share the link to this topic with your customer so he can jump in - maybe this direct contact would be more efficient.
Hopefully I clarified some things with this post for your customer.
Kind regards,
Razvan.