LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String array by VISA write

Hi everyone,

 I'm using Labview 2017

I need help about my new progect. I have to write by VISA different strings come from loop as shown in picture attached. I can't find way to do this. Can anyone help me?

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

Your workflow will look like this:

  1. Auto-index the next element.
  2. Do your bit-wise operations.
  3. Concatenate your string.
  4. Send the string via VISA Write.vi.
  5. Wait for 250 ms. then read the reply using VISA Read.vi.
  6. Auto-index the results.
  7. Repeat until the input array has been completely auto-indexed (this is automatic).
  8. Work on the data array outside the loop.

A hard-coded wait followed by Bytes at Port property usually (99% of the time) indicates a failure to fully comprehend the actual communication protocols needed.  I've only seen ONE case where the manufacturer actually recommended a wait of x ms to allow the instrument to process the command that was sent.  Even then, Bytes at Port wasn't needed.  Usually I see this method used when the developer takes code right out of the serial port example.  Normally, copying the example is a good way to implement something, but in the case of the serial port example, well... IMHO it needs to be replaced.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(2,360 Views)

Hi Bill,

 

thanks for your reply. Actually I used Bytes Port in other project and I never had problems. 

Any way your steps about my project are correct.

My issue is that I don't find way to contacted the Loop output to Write Visa input.

Do you have any solutions?

Thanks

Antonio 

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

@Antonio81 wrote:

Any way your steps about my project are correct.

My issue is that I don't find way to contacted the Loop output to Write Visa input.

Do you have any solutions?


Your Write and Read process should be inside of the FOR loop.

 


@Antonio81 wrote:

Actually I used Bytes Port in other project and I never had problems.


You just got lucky.  You WILL run into issues when using an arbitrary wait with the Bytes At Port.  Use the messaging protocol to find your data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,316 Views)