NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
aviadCielo
Posts: 22
0 Kudos

What is the analog command of ncCreateNotification in the NI-XNET API?

Hy,

 

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,

Aviad

Member
Ryan_S
Posts: 70
0 Kudos

Re: What is the analog command of ncCreateNotification in the NI-XNET API?

Hey AviadCielo,

 

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)

http://www.ni.com/pdf/manuals/321370c.pdf

 

NI-XNET (See page 5-40 for C API)

http://www.ni.com/pdf/manuals/372840e.pdf

 

Hope this helps!

 

--Ryan S.

Applications Engineer
National Instruments
Member
aviadCielo
Posts: 22
0 Kudos

Re: What is the analog command of ncCreateNotification in the NI-XNET API?

Hy Ryan,

 

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,

Aviad

Member
Ben-N
Posts: 121
0 Kudos

Re: What is the analog command of ncCreateNotification in the NI-XNET API?

Hi aviadCielo,

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.

Ben N.
Applications Engineering
Certified LabVIEW Developer
Member
aviadCielo
Posts: 22
0 Kudos

Re: What is the analog command of ncCreateNotification in the NI-XNET API?

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).

 

Thanks again,

Aviad

 


Member
Ben-N
Posts: 121
0 Kudos

Re: What is the analog command of ncCreateNotification in the NI-XNET API?

Hey Aviad,

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.

Ben N.
Applications Engineering
Certified LabVIEW Developer
Member
Gibson
Posts: 114
0 Kudos

Re: What is the analog command of ncCreateNotification in the NI-XNET API?

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.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page