LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Visa have any buffer/memory or similar?

That was easier, only had to put a "flush buffer" in a sequence structure, in the same part I configured the initial values and that's it, only that I have to be out of the while I have in the other part of the sequence, but that's not a big problem.

 

Another question I have. How can I make a boolean from a number or a string? It's for example to light a LED when there's data through a wire.

0 Kudos
Message 21 of 48
(1,358 Views)

There are several ways..  Wish I had LV installed here, I could whip up some examples..

 

An easy trick is to simply wire to an EQUAL..  for instance a number 1 = 1 gives you a TRUE.  Same for string "1" = "1" is TRUE (boolean 1).

Message 22 of 48
(1,350 Views)
Yes but it would only work if data through that wire is 1 isn't it? If I have another number, that condition isn't true
0 Kudos
Message 23 of 48
(1,339 Views)

Not if you make value 1 default.  It will take any value other than 0 which is the other case.

 

The "default" case is the "catch all" case for what the other cases do not cover.

 

It works fine, try it..  😉

Message 24 of 48
(1,330 Views)
Oops, don't catch it. You say to make a case with the condition made by a comparator of the wire where data goes through and a "1" ?? I think you don't want to say that, because that doesn't work 😞
0 Kudos
Message 25 of 48
(1,320 Views)

I had to read my post again to make sure I didn't put quotes around the 1 (ie "1" ).. I didn't ...  😉

 

Okay..  you didn't get it..

 

Look at the image below:

 

 

 

If you implemented this already, then you should have seen that it works.

The other case (not shown) is 0 (zero).  That means it executes the other case if there is nothing at the port, thus the bytes at port = 0.  And there are no VISA Read in that case because there is nothing to read.

 

However, if there are any amounts of bytes at the port, then it will go to the case shown above.  Not only for the value of 1, but for any non-zero value.  So the case shown above will read whatever amount of bytes is reported by the property "Bytes at Port".  If it is 1 byte, then it will read 1 byte.  If it is 1234 bytes, then it will read 1234 bytes.

 

That is why I suggested using this method instead of hardcoding a large value to the VISA Read.

 

R

Message Edited by Ray.R on 03-19-2009 11:48 AM
Message 26 of 48
(1,310 Views)
I forgot to mention:  there is no need to create any other additional cases.  You only need two; one for zero & the other for one (which should already exist as per example).
Message Edited by Ray.R on 03-19-2009 11:53 AM
0 Kudos
Message 27 of 48
(1,304 Views)
Thanks Ray, it's usefull to know that for VISA read, I'll try it but we are talking about different things Smiley Very Happy . I am refering to a wire that doesn't come from a VISA port or similar, it's only a wire where sometimes data goes trough and I want a LED that turns ON when there's data trough the wire and turns OFF when there isn't 🙂
0 Kudos
Message 28 of 48
(1,303 Views)

Oh.. then you could place a boolean TRUE in the default case (1) and a boolean FALSE in the zero (0) case.  The wire from those could go to your LED.

 

Sorry for misunderstanding.

 

R

 

PS:  You do realize that your LED might blink like crazy depending on how fast data gets into the buffer.  Not unlike the LED's on an Ethernet Port. 😉

 

Message Edited by Ray.R on 03-19-2009 11:55 AM
Message 29 of 48
(1,301 Views)
Yes, that's what I thought, but I cant' wire a "property node" to a simple wire 😛
0 Kudos
Message 30 of 48
(1,297 Views)