06-20-2012 03:23 AM
I'm using NI-XNET, with C++ at QT environment, Windows 7.
I'm looking for command that notify if a specific frame received from the network, something like the ncCreateNotification.
Thanks for advance,
06-21-2012 06:28 PM
I'm not sure if there's an exactly comparable command for ncCreateNotification in XNET. However, you may be able to use a variation of nxWait or nxReadState. Similarly, depending on if you're just checking for a frame, you could use nxReadFrame with a switch statement for the value you're looking for and then a default that does nothing. For details, I'd recommend looking through the NI-CAN and NI-XNET manuals linked below:
NI-CAN (See page 3-4 for ncCreateNotification)
NI-XNET (See page 5-40 for C API)
Hope this helps!
06-24-2012 02:17 AM
Thanks for the reply!
Maybe I need to be more specific - I would like to read data for a frame just if data available, something like:
ncCreateNotification(..... ,NC_ST_READ_AVAIL , ......)
All the best,
06-25-2012 06:37 PM
There isn't a directly related call for XNET that equates to the ncCreateNotification(...) for NI-CAN. What exactly are you trying to achieve? Are you looking to wait for an item to be available in the read buffer before a read call is made? Are you trying to do this so other sections of your code can execute, aka using this for multithreading, or for some other use? I'm just trying to understand what exactly you are trying to do to see if we can come up with an approach for you.
06-26-2012 01:21 AM
Thanks allot, I really appreciate.
Like what you wrote, I'm looking to wait for an item to be available in the read buffer before a read call is made, in order to:
a. Let my code run, with no need to Implement scheduled polling to get the data.
b. On my network, there is an ECU that transmit a fixed Sync message. I'm looking for a way to check if the sync stopped. I'm use to do it with notification, using the Timeout feature (if the sync data not available after X sec - sync failed).
06-27-2012 10:25 PM
So my initial impression is that I don't believe there is a notifier for NI-XNET like there is for NI-CAN. If you conifgure a session to read a single point frame, does this not achieve the behavior you are looking for? Looking at our documentation for migrating from NI-CAN to NI-XNET, I'm not sure that we have a notifier specifically for the NI-XNET driver like existed for NI-CAN. I'm going to have to look into this a little more to very definitively, but I think your best bet may be using a polling type call. Additionally, a single point input session may work for your needs as well. Let me look into this more and I will follow up with you soon.
06-28-2012 01:13 AM
NI-XNET so far does not support notification like NI-CAN. You would need to poll the frame, but I would not suggest the SinglePoint read, as you cannot verify the timestamp of the received data. I would suggest to use a queued Frame or Signal input mode, which allows you to verifiy the timing of the received data. There are several examples included in NIXNET, which you can use as a starting point.