10-23-2006 04:14 AM
10-23-2006 09:22 AM
Both is possible. If you choose the channel api, you need to configure at least one channel first. because the confioguration has to be done for both, in the end you would use the read in a case to catch the button press. The channel has to bge configured with sample rate 0 to send only on call of nct read.
In the end your choice depends on your data you would like to send. If you need to change the bits or bytes before sending, i would prefer the frame api. If it is easier to use physical values use the channel api.
DirkW
10-23-2006 09:54 AM
Thank you very much DirkW
Just a little question : when you said that the configuration has to be done for both, what do you mean BOTH? The Frame and the Channel API?? I have actually a message named MsgFT which is associated with my database created under Vector Database Editor (.dbc) and it dispose a channel named Action with 8 bits of data, so that i think the first channel is configured as you said in your message.
In fact, there isn't physical values in my message CAN, just some significative values for my buttons (i have 20 on my front panel and each button is associated with a value, ex : 0000 0001 for the first button and 0000 0010 for the second). I should send the right message on the network if the corresponding button is clicked.
So i thought to creat a sub-VI "SendMsg" with on his input the value to send and the function "Write" will be called in this sub-VI. In this case, it is better to use the Frame api, right?
Thanks
10-24-2006 09:08 AM
Hi,
No. don't get me wrong. If you have a channel using a single byte, this is like using the frame API, because CAN uses the byte format to transfer the raw data.
Only if your channel uses more then a byte, it would be easier to get the bits with the frame api. In your case the channel api should work.
DirkW