Jump to content

Eric U

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Eric U's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I tried using the Visa clear, but it apparently sends a "break" which confuses my remote device. So I open the serial port, close it, and then open it again. Now I can stop the vi any way I like.
  2. Long ago enough that I forget all about it, I wrote a serial port program in C that used visa calls for the serial port. Now I'm writing a labview serial port program, and it doesn't have all the functions I want. Specifically, I want the visa init to clear the serial port. I didn't see a function that would allow that. Apparently, the easiest way to do that is to open the serial port and then do a visa close, and then open the serial port again. If I start and stop the serial port with the stop button on the window's toolbar, it doesn't clear the serial port, and my program doesn't work properly. I have it set up so that if you push my stop button, it does shut down the serial port which clears it. I'd hate to have to write a function to clear the serial port myself, it's just silly. Is there a way to trap the stop button on the toolbar, or disable it? My experience with the HP visa was that it was much better at handling the serial port than I was with C.
  3. We did get the read to work. It turns out that our situation was somewhat more complicated because we alternate messages with different formats. However all messages are preceded with a fixed format header. We didn't use byte swapping on the labview side; the c++ side does byte swapping to network format. Now we have to figure out how to put the network code in a separate thread.
  4. I'm new here, looks like a very nice forum. I want to do the same thing as the original poster, execpt I'm reading off of a tcp/ip connection instead of writing. If I knew the first thing about labview, I'm sure this vi would be very useful. We already have filter applications which could send out network data in strings if needed, but I'm not sure the performance would be acceptable. In C there are functions ntoh_ (network to host _) and hton_ (host to network _) which do the byte swapping as required for the data type _. It looks to me as if the byteswap functions in labview swap bytes no matter what, which is not the behavior of ntoh_, which only swaps if the native format isn't swapped. If labview uses network order, I suppose I could skip the byte swapping, but it's not good form. Anyone can confirm this? I have never seen anyone byteswap floating point numbers since almost all computers use IEEE formats as their native format. The NI site is the first mention of byteswapping floats I have ever seen.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.