LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading through an RS-485 or a an Ethernet Hub,.??? and HOW ??

Solved!
Go to solution

At Krishna :

 

I shall look into the code tomorrow and tell you. Actually i did some small manipulation and now and i get an output for the frequency channels.. They give the correct answer but still i can get to figure out how to get them in a waveform. I shall update you tomorrow..

 

At  Ravens Fan 

 

Thanks for the resource. I shall go through them too and try to make the code better.

Thanks again for your help and support. I am slowly pinking up on LabVIEW.. will take some time.

 

 

0 Kudos
Message 11 of 20
(1,401 Views)

Hi..

I modified the code a little bit.. made it a little simpler.. i removed the part on the bottom and now i have 2 inputs to the TCP port and 2 outputs.. all seems to work well now.. I get the desired output on both loops..

Here is a doubt i have ..These data outputs are not continous. They give me a value after a timelag. the time lag is probably that labview needs to communicate to the Ethernet server and get an output. Is there a way possible to get continous data and have an output in the form of a waveform chart ???

I need to monitor the Frequency on both channels on a continous basis.. I cant directly get a Waveform output from the TCP/IP read. can anyone suggest a way ?? Excude me if my question is stupid..

 

By the way u = you 🙂 .. just a short cut...

 

P.S : Code Attached

0 Kudos
Message 12 of 20
(1,387 Views)

Hi Allagain..

i modified the code a little bit in the following fashion.. There seems to be an error in creating the Waveform .... i know i cant pull out data out of the Loop but i dont understand how else i can get to form a waveform for the Digital data..

Can anyone please have a look in the code..

0 Kudos
Message 13 of 20
(1,384 Views)

I wouldn't create two separate loops that are trying to communicate with the same IP address and same port.  I'd be surprised if you weren't getting garbled messages between the two loops as the commands "race" each other between the writes and the reads.

 

Any communication protocol is not going to be continuous.  It is always going to be some lag time due to the time to write, the time for the other device to get the command and process, and the device to send the data back to be read.

 

No you can't do what you are doing in your latest VI.  Your loop is set to run continuously.  No data comes out of that tunnel until the loop completes.  It is one of the basics of LabVIEW and dataflow.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
Why don't you put all the other code inside the while loop?
You really should have a stop button controlling the stop condition terminal of your while loop.  As it is right now, the only way to stop your program is to hit the abort button.  And means the code outside the loop (including your waveform creation and the close TCP/IP port) will never run.
0 Kudos
Message 14 of 20
(1,378 Views)

Hi RavensFans..

 

I have started going through the material but it wont be until weekend till i get into it seriously.. That is why maybe my doubts may still seem silly.

 First things first..

 

a. I shall incorporate a stop button tomorrow and then run the loop.. also i ll make sure that all are in one single loop.

b. Still i have a feeling that the data out of the loop in the end of the cycle would just be the last value read by the TCP and wont create a waveform data..  I shall look into that too..

 

So are you saying that this is as fast as data aquisition through the Server can get  ??? there is no way to get a faster and more continous data ??

 

 

0 Kudos
Message 15 of 20
(1,370 Views)

shanky1023 wrote:

Hi RavensFans..

 

I have started going through the material but it wont be until weekend till i get into it seriously.. That is why maybe my doubts may still seem silly.

 


 

 You have doubts?  What parts don't you believe?

 


shanky1023 wrote:

 

So are you saying that this is as fast as data aquisition through the Server can get  ??? there is no way to get a faster and more continous data ??

 


Any network communication is going to have some inherent lag.  Exactly what device are you trying to communicate with?  How much data does it send and how often?  How fast do you want to read it?  Your VI's show that you are only reading 3 or 4 bytes.  That is not much data at all.  With the inherent network lag, that is going to make your communication speed per byte seem relatively slow.  Network communication is optimized to send data in packets.  Let's say 1024 bytes at a time. (Not that I am not an expert in network communication.) If you are sending too few bytes, I believe the network will wait a bit to make sure no other data needs to be sent before it sends out that small of a packet.

 


shanky1023 wrote:

b. Still i have a feeling that the data out of the loop in the end of the cycle would just be the last value read by the TCP and wont create a waveform data..  I shall look into that too..

 


Exactly.  That is what I'm saying.  With your current VI setup, you would only get the vary last value of the TCP/IP read out of the loop.

 

I don't know whether it makes sense for you to be working with the waveform datatype.  The waveform datatype is intended for a series of data where you have a constant time interval between datapoints.  Since you are reading data one piece at a time at a rate that could vary depending on the network communication, you won't have a constant time interval.

 

You should probably be building your data into arrays where you have a time value (X) and a data value (Y).  Build the data into arrays that you store in shift registers, and use an XY graph that you update on every loop to continuously show the new data coming in.

0 Kudos
Message 16 of 20
(1,364 Views)

Hi Ravens Fan

 

Sorry for posting it in the other forum. I ll stick to his one from now..

i meant i would have lots of doubts till i get to learn the tutorials properly that is this weekend. I am so sorry to bother you with my incompetence.

 

About the rate of data u asked for i checked the manual..

 

I am not sure what to be looking for but i believe it is 256 Kbyte capacity. Here is a link to the manual..

 

http://www.omega.com/iseries/Pdf/M4051O.pdf 

 

And about putting things in the loop as well as Changing it to an arrray i will look into it first thing in the morning tomorrow in the lab.. 

 

Basically why i started off to build a waveform was because i wanted an output like in Fig 4.9 of the manual . only difference is that i wanted it to be in Hz. I was finding that the output was a string type which started all the problem...

 

 

0 Kudos
Message 17 of 20
(1,358 Views)

Hi Ravens Fans

 

I incorporated the STOP and error display button in the programme.. I just kept 2 while loops so that i can track each separately. Could make it into one.

I got the concept of how i could make it an X-Y chart but my primary worry now would be how to sample data faster in LabVIEW..

 

Its takes about 5 seconds for the programme to update any change in the system input frequency. But in the conventional software given with the Equipment the data samples really fast and updates immediatly. Can you suggest something about how to communicate faster and get more samples in LabVIEW ??

 

Thanks..

0 Kudos
Message 18 of 20
(1,341 Views)

Hi,

 

 

I was looking on the forums for a similar solution to my problem. Only that my remote system needs me to boot it (I am the server sort of speak).

It keeps giving me it's MAC address so the first thing I want to do is read that address.

 

After that is done my guess is that I can controller my remote DAQ's using Ethernet. With some use of the VI that was posted here.

 

 

So my question is : Can I read a MAC address from my Ethernet port in Labview?

 

 

I am not that experienced in Labview either, because I am a student on a internship. But I know my basics very well.

 

 

Thanks for the help already !

Steve

0 Kudos
Message 19 of 20
(844 Views)

Hi Steve. 

 

Are you just trying to control a DAQ device somewhere on your same network from your computer?  Why do you need to read in the MAC address manually?  If you are trying to do the former, as long as you share the device you should be able to control it that way.

 

What DAQ device are you using?

 

Jon S

Applications Engineer
National Instruments
0 Kudos
Message 20 of 20
(821 Views)