LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access host data from local computer

Host = My Computer, don't need IP

Target = cRIO, IP is 172.22.11.2

 

I'm assuming Host IP is 172.22.something.something and Subnet Mask is 255.255.something,0.  If the first "something" in Host IP isn't 11, then the Something in the Subnet Mask has to be something like 252 (which means "needs to match the top 14 of 16 bits").

 

That should fix the problem.

 

Bob Schor

0 Kudos
Message 11 of 15
(824 Views)

Hi Bob,

I have tried your suggestion, but it still not working. I have attached VIs here. (Version 17). I noticed that my Subnet Mask is no 0 at the 4th location, would that be the problem, see attached?

 

Thank you,

Drake

0 Kudos
Message 12 of 15
(815 Views)

OK.  I'm currently a few hundred miles from my RT System, but through the Magic of Remote Logon (not to mention having Subversion to keep the code available), I have a "Model" you can copy.

 

Let's start with the Hardware.  My PC has a second NIC that is used as a Private Network and connected directly to my Real-Time Chassis, a PXI system.  The Host (PC) has an IP of 10.0.0.101 (a 10-dot network is "non-routable" and hence can't go on the Internet).  I gave it a Subnet Mask of 255.255.0.0, meaning it can connect with anything it "sees" with an IP of 10.0.x.x (where "x" is any 8-bit number, 0 .. 255). 

 S-Lab Project.pngS-Lab Sample Stream.png

 

As you can see from my Project, the PXI has an IP of 10.0.1.103 (and a similar sub-net mask), so the two machines can "see" each other.

 

The RT (PXI) side is acquiring 16-bit Analog data and is streaming it to the Host (PC) as an array of 50 I16s.  I have named this string "Smpl" (Sample).  The two functions that create the Reader (running on the PC, top) and Writer (running on the PXI, bottom) are shown above.  You will note that I gave the PC the name "UI" (for User Interface) and the PXI the name "RT" (for Real-Time).  In this Project, I have three other Network Streams that are configured similarly -- what differs is the name of the Stream (e.g. "Smpl") and the type of Data.

 

Note that when creating the Reader on the PC, I don't need to specify the PC's address, but do need to tell the PC where to find the Writer (i.e. the PXI's address).  Similarly, the Writer (on the RT side) doesn't need to know its own address, and once a Reader/Writer connection has been established, you only need IPs for one side.

 

A note about hardware.  The PXI gets started first, and runs its code.  It starts by "listening for a connection" -- if 15 seconds go by without one, it times out and tries again (it can do this for days ...).  The PC "expects" that the PXI, at 10.0.1.103, is "on" and "listening", so when it starts, it tries to connect.  Since you sit at the PC, if the PC fails (three times, or 3 * 15 seconds) to connect, it generates an Error Message ("Turn on the PXI, Dummy!") and aborts.

 

Hope this clarifies things and you get your streams to connect.  The question about Network Addresses and Subnet Masks definitely have to do with how you are connected to your cRIO.  I noticed that your Host and cRIO had very similar IPs, one with a final octet of 1, the other of 2.  The subnet mask 255.255.255.248 means that the addresses have to match except for the last three bits of the last octet.  Since 1 is 000001 in Octal, and 2 is 000002, they only differ in the last three bits, so they should match.  But how are they connected?  Is it a "private line", or are they plugged into a "normal" network?  If they are directly connect by a cable, it must be a crossover cable (you can recognize these by holding up the "ends that plug in" and noticing if the colors on the wires have the same order -- regular cables will "match", but crossovers might have Orange on the outside on one plug, and in the middle of the other).  Because Crossover Cables are "rare" (for good reasons!), I usually use two regular cables and an inexpensive 4-port "hub" which serves to do the crossover for me (at around $30, these mean you never worry about the Cable -- if in doubt, throw it out and try another one).

 

Bob Schor

0 Kudos
Message 13 of 15
(793 Views)

Hi Bob,

Greatly appreciated for taking the time for this thorough explanation. There are s few things that I still need some clarification.

1) The way I connect the DAQ is using cRIO 9048 chassis with NI-9234 module through a usb-c to connect between the chassis and the host PC. Since the PC is able to detect the cRIO 9048 chassis, the crossover cable might not be necessary. Is this correct?

2) Since we are using different RT hardware, how do I find out if my RT is acquiring 16-bit analog data and stream as an array of 50|216s?

3)

On the Reader end, you named:

UI/Smpl/Reader

//10.0.1.103/RT/Smpl/Writer

On the Writer end, you named:

RT/Smpl/Writer

I couldn't see UI and Smpl naming under the Project Items you have attached. Did you name and save them in a separate file/project? Or did these naming are just for us (the author) to easily identify which are paired together?

 

Thank you,

Drake

 

0 Kudos
Message 14 of 15
(768 Views)

Sorry, Drake, I'm not familiar with your hardware.  When I saw reference to an IP address, I thought about conventional networking with Ethernet cables, similar to the ones you use to connect your PC to the (wired) network.

 

I'm not sure I've seen the code that shows you packaging up data to stream.  In my case, in my "Samples" stream (that I gave the purely-symbolic, arbitrary, name "Smpl"), I knew they were arrays of I16 coming over at 1kHz, I chose to send them in arrays of 50 points at a time (in part because I was displaying them at 20 points/sec, so I just either display the average of the stream as it was received or the first point of the stream -- what varies in these choices is the "noisiness" of the display, an interesting Exercise for the Reader).  Presumably you can look at your code and (from the wire type) determine what your RT is acquiring, and stream accordingly.

 

The names UI and RT were names I chose to help me remember/know whether I was on the User Interface (e.g. PC) end or on the Real Time (e.g. PXI) end.  I had, in this program, 4 Network Streams, each with a unique name for the type of Data they carried.  I showed you the Stream carrying Samples, hence the name Smpl (I'm allergic to vowels).

 

Bob Schor

0 Kudos
Message 15 of 15
(764 Views)