Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Heidenhain ND-287 connect with VISA

Solved!
Go to solution

Hey guys me again!

 

I've got a problem with the programmer.

Receiving the data from the ND-287 is working good.

But when I push the stop button in my programmer when all the data is received the programmer won't stop.

It keep running until a time out error!

How can solve this problem, so I can stop the programmer at any time?

 

Thanks 

0 Kudos
Message 21 of 30
(2,638 Views)

Hello Poppe,

 

Can you tell me which stop button you are pressing?

After how much time do you get a timeout error?

Can you post a screenshot of the error so that i'm sure about where it's originating from.

 

Just for completeness:

Do you use the Run or the Run Continuously button to run you application?

Which debugging steps/methods have you already tried?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 22 of 30
(2,627 Views)

I push the run button!

 

I've  put all the commands in a while loop and let it continue as long as I don't touch the stop button, didn't work!

0 Kudos
Message 23 of 30
(2,622 Views)

Hello Poppe,

 

No need to yell at me.. 🙂

I was just making sure everything was correctly set-up.

 

What happens if you press Run, wait 20 seconds and do not press anything?

Do you also get the timeout?

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 24 of 30
(2,609 Views)

Yes it does. 

But the error is not my biggest conserve. 

The problem with the stop button is.  Because after I received the data from the ND-287 I want to stop the program.

 

Sorry for yelling. 🙂

 

 

0 Kudos
Message 25 of 30
(2,603 Views)

Hello Poppe,

 

I think I might have misunderstood what your exact problem is.

 

Is it the fact that your code doesn't stop immediately?

Or is it the fact that you get this error when you press the stop button?

 

Or is it something totally different?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 26 of 30
(2,595 Views)

Hej,

 

 

I get the code perfect. When I 'm receiving the code I can push the stop button and the program will stop.

But when all the code's are received and I push the stop button, than the program still runs until the time out error appears.

 

 

Thanks

0 Kudos
Message 27 of 30
(2,593 Views)

Hello Poppe,

 

With this code this is normal.

As far as I see your code is written in such a way that it will continuously try to read out data through the VISA Read call.

This will make cause your code to wait in the VISA Read VI until you either receive 1000 bytes or your timeout occurs.

 

In your case you will be waiting in the VISA Read VI because no data is coming through anymore.

The amount of time you will wait is specified in your code by the "Timeout input" terminal of VISA Configure Serial Port VI.

 

Change this value and your timeout should occur faster.

 

1) Do you want your code to stop when you don't receive data anymore?

Because based on the current code this is what will happen:

Whenever a timeout (and teh corresponding error) occurs, your code will stop.

 

2) Do you want the timeout to occur but not interrupt your application and use the stop button to stop your application?

 

3) Do you know in advance how many samples you're going to read out?

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 28 of 30
(2,591 Views)

 i think question 2.  

What I no can do is, receiving the data and stop the program before the last data is received.

When I push the stop button after all the data is received. The program continue running until the error comes up.

What I'm trying to do is, that the program also stops when I push the stop button when all data is received.

 

 

Thanks

 

0 Kudos
Message 29 of 30
(2,588 Views)

Hello Poppe,

 

I assume that you mean:

"What I now can do is receiving the data and stop the program before the last data is received."

 

In that case it's normal because you're not waiting for the timeout in that case.

You could verify this by just outputting the timeout terminal.

 

In your case I would suggest using a smaller value for the timeout (to make it not wait so long for data).

If you don't want to see the timeout error, then you could clear that specific error before it reaches the conditional terminal of your loop.

You should however be careful with this, because then you might also miss other errors.

(Logging any cleared specific error would also be a good idea or at least logging how often that specific error occurs)

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 30 of 30
(2,571 Views)