LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a RF server.

Hello!

Well, I am working in a project that requires the following:

RFserver.png

 

I need to know any opinion about the possibility of implementing this, specially point 4. What should be the best option to send the selected string to another computer? Trough a third Serial port? Via IP?

Thank you.

Duarte

0 Kudos
Message 1 of 4
(2,652 Views)

I assume this is a school assignment, as I cannot imagine a "real" project would be so vague.

 

1.  Receive data from two different antennas connected to two different USB ports (receiving strings of characters).  The strings are the same.

 

"Antennas" are generally not connected to USB ports, but rather to receivers.  "USB port" is vague -- I assume this means a serial port with communication via VISA, but maybe not (there are two functions on your Block Diagram that seem to be related to two COM ports).  There is no description of the expected data format, making it challenging to know what/how to read the data.  I find "The strings are the same" a curious specification ...

 

2.  Check the consistency of each string (using CRC).

 

No information about the expected string has been given, so it is unclear what is meant or expected by this suggestion.  [If you know, go ahead and "do what you are supposed to do" -- I would complain, myself ...].

 

3.  Choose the best string and reject the other.

 

What is "best"?  From Step 1, the strings are identical, so how can one be "best"?  From Step 2, if they are, in fact, not identical, one might have a valid CRC, the other might not, hence you could understand "Best" as "Correct CRC".  But what if both, or none, have correct CRC?  And what if the strings are just plain different (with valid CRCs)?  [Go back and read first question in this paragraph].

 

4.  Send the selected string to another computer and save it in a simple database (text).

 

What's with the "another computer"?  I'll assume it is a PC running Windows.  Does it have a network connection?  Are you on the same Network?  Are you supposed to be writing/running a "Listening" program on it?  Are you expected to interact via some Web service?  What is meant by "a simple database (text)"?  Is it enough to simply write (or append to) a text file?  If it is a database, are you supposed to (remotely) run the database routine on the other PC and incorporate these data?

 

This last step is many times more vague and unspecified than the previous three.  It is unclear if you need one (LabVIEW) program on your Host machine and a different one on the Remote, or whether the Remote is just a "dumb repository", or a server of some sort, or something else.

 

I've done things similar to Step 4 (such as updating the start-up routine of a LabVIEW Real-Time Platform).  One way I've done this is as follows:

  1. Know the location of the file I need to modify on the Remote, as well as the IP of the Remote (which is running FTP Server).
  2. Use FTP to bring the file to the Host (i.e. to my LabVIEW program).
  3. Modify the file as needed.
  4. FTP the file back to the Remote.
  5. Force the Remote to "pay attention" to the file (typically by forcing the Remote to reboot).

Bob Schor

Message 2 of 4
(2,618 Views)

Ok, lets go then:

Please consider the snippet posted just a kind of inital diagram of concept. I know it's simple so let me explain using the same 4 topics.

1. We have two Yagi antennas connected to RF transceivers and then to separate Serial Ports. The functions you can see in the snippet (called APC220) are two identical subVI's (done, tested and working fine).But why two antennas? Just for redundancy.

On the output of this functions I will get a string. This string (more or less 100 characters) is composed in an objet flying in space and sent to our ground station (a PC running Labview). This flying objet gets air temperature, atmospheric pressure, altitude, relative humidity, data from a 9DOF IMU device, GPS coordinates, sensor state (on/off), battery voltage, etc. Then creates a string that starts with ETS#1#, where ETS is an identification code and 1 is the string number. All the variables are seperated using ";". The last parameter of the string is the CRC value. For example the string number one will be:

ETS#1#19,8;1023;150,34;..., where 19,8 is the air temperature, 1023 is the pressure, 150,34 is the altitude in meters and so on.

Currently our main VI receives the string and split's the data showing each variable in diferent indicators. It's working fine and will be running on what I call the "another computer".

2. Regarding the CRC verification I still don't know how to do this but I'l get there. I am working on a C++ algorithm to generate de CRC and then I will dedicate some time to implement the verification in LabView.

3.  Ok, if the two strings are equal (no errors in CRC cheking) then I must create a proirity. For example I can say that the string comming from Antenna 1 has priority. If one of the strings failed the CRC check his rejected and the other is considered (if CRC check is OK). If any of the two strings is CRC OK then the last "good" string is computed again.

4. After selected the string to be used (the new one or the last "good" one), then we have to do two things: 1-save the new string or get the last "good" string and... 2- Pass this string to another computer where will be running the main VI (as described in topic 1) to split the variables and show in the front panel using indicators, waveform charts, etc. I still haven't decided the way to connect the two computers but I was thinking creating a small network with a router. We are using a wireless 4G router to access Internet, because we have a realtime Google Maps indication of our object location but maybe is wise to use a diferent router.

Before you ask, this system will be working in a field operation running on batteries, with no network access of any kind but 4G network.

I hope I did explain better my project context.

I am sorry for the lack of better information on the first post but I tried to follow your advice: "say what you want to do not the way you wnt do do" 🙂

Thank you!

Duarte

PS- Don't forget to apologize my English.

 

0 Kudos
Message 3 of 4
(2,600 Views)

Start simple.  I have no idea (and it probably isn't important) what instrument is generating the data string you describe (a "semi-colon delimited string"), but you do seem to know its structure.  It isn't clear if you are generating this string (and therefore controlling its format) or it is a "given".

 

So the "string" question is why worry about a CRC?  If you control the string, get your routine working without the CRC, and once the "simple" version works, you can add additional complexity to it.

 

Similarly, forget the second antenna (which you are using "for redundancy").  Work out how to handle one, then you can "complicate" it with adding redundancy.  [I have to admit I don't see a rationale for the additional complexity unless you really have very poor transmission channels, in which case you might work on improving the communication path or coming up with an encoding scheme that has error-correcting properties].

 

Now your entire process is much simpler -- read and parse a string from a single antenna, save it, and display elements in indicators.  Going back to the K.I.S.S. (which stands for Keep It Simple, Stupid) Principle hinted at above, why are two computers necessary?  Why can't a single computer "do everything"?

 

[Actually, the answer might be "because we have two computers and that's part of the Design Specification or Homework Specification".  In which case, "Solve the Simple Case First", i.e. one computer, then once that is working, see if the problem "breaks" into two parallel pieces (as it would if you designed it as a Producer/Consumer Design Pattern), assign each piece to a separate computer, and use some form of networking to communicate.  But first get the basic Algorithm working with the Simple System!].

 

Bob Schor

 

P.S. -- this is not intended to be a "private conversation" between DuarteCota and me ... 

0 Kudos
Message 4 of 4
(2,584 Views)