Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Cyclic Remote mode in the XNET driver for CAN

aglet,

 

So, you're saying that when the session is initialized, a device on the CAN bus sends a bunch of frames with empty payloads? And then there are additional "Command" messages that are also being sent with empty payloads? 

 

When you first start the Frame In session, how many empty frames do you see?

0 Kudos
Message 11 of 14
(2,912 Views)

Your questions suggest I have not been clear. There are two contributors to the problem that I am working through.


1. The NI-XNET driver implementation

2. The communication specification that I am working with.


XNET driver: The XNET driver when in Frame Input Single Point mode will return an array of data when performing a read action. This array will contain all frames that the session was initialized with, regardless of whether or not data was received on the bus. However, the payload of the frames not received will be all 0's.


Comm Spec.: When sending a "Command" frame the data is sent across the bus with an unused payload (the receiver is keying on the arbritration ID) this payload may contain any data including 0's, which is often the case.


Pair the two of these together and I have little that I can key off of to tell if a frame read back from the read action is actually a received frame. I am currently using the timestamp but I am not sure how reliable this is going to be.

Specifically answering your questions.

So, you're saying that when the session is initialized, a device on the CAN bus sends a bunch of frames with empty payloads?

No, I'm saying that this is what the read action returns

 

And then there are additional "Command" messages that are also being sent with empty payloads?

All of the "Command" messages are sent with empty payoads

 

When you first start the Frame In session, how many empty frames do you see?

If you start a Frame In Single Point session and perform a read action you will receive all frames the session is initialized with.

 

BTW: An implementation of the Event remote and Cyclic remote timing modes that would allow me to assign an ID combination would have made this implementation easy.

0 Kudos
Message 12 of 14
(2,896 Views)

aglet,

 

Is it possible for you to disregard the results of the first Frame Input Single Point Read function? Is there information that you parse from this glut of initial frames?

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 13 of 14
(2,880 Views)

I have a solution that seems to be working at this time.

 

I've keyed off of the timestamp and payload.

1. I start with asuming that the payload array of each frame is going to be 0's

2. If the payload array contains any data other than 0's or the payload array is null data then this is a frame of interest.

3. Compare the timestamp with the previous iteration timestamp if the timestamp is newer then this is an updated frame and do some magic then pass this new frame into the next iteration.

 

Messy but seems to work.

0 Kudos
Message 14 of 14
(2,868 Views)