Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Tektronix AFG3022B do not want instrument reset on calling Initialize vi

Solved!
Go to solution

I don't really care whether you have 2 channels or 200 hundred. You simply cannot do parallel operations with that instrument over USB, GPIB, or any other bus. You don't really think the 'serial' part of USB means you have parallel links, do you? The instrument has two channels but USB certainly does not. You may have been lucky. You might want to do a little basic research on GPIB which is the model for your USBTMC instrument.

 

Of course you can run the default instrument setup alone. You just have to open it, set the visa resource, and click the run arrow. That's just basic. And, you do not have the run the initialize or close at any point. That's also basic.

0 Kudos
Message 11 of 18
(2,716 Views)

I know what the s in usb stands for. I can Highlight Execution and see my channels being

set up and switched on one after another. That's physically fine for my application. I accept it's

not good practice. I'll daisy-chain them instead.

 

My reluctance to run sub VIs of the instrument driver as stand-alone entities is not down to ignorance about

how to do it. As I obviously don't understand how it's working, I didn't want to potentially cause errors by

running them in the incorrect order.

 

Today, I swiched everything back on and ran the VI which appears in my original post with no errors,

regardless of whether the Reset input  to Initialize VI is set to T/F. I have not changed the code, swopped

usb ports or anything like that. I do not know why the error is not occurring now. 

0 Kudos
Message 12 of 18
(2,694 Views)

Hi,

This issue is not resolved. The error is occurring today exactly as per my original post. No changes made to code.

When Reset=T tkafg3k Initialize.vi runs fine. When Reset=F I get the error in attached png. It doesn't occur immediately after

the T/F case structure, but in the last Error Query VI.  

0 Kudos
Message 13 of 18
(2,663 Views)

Hi Lizzied,

 

Firstly I'd like to point you in the direction of another forum I have found. It mentions a similar issue to yours regarding the timeout error you are getting at the Error Query VI. It appears there is an issue with the Error Query VI in this Tektronix driver. This chap managed to create a workaround for the issue but maybe not in the best way.

 

I noticed on your screenshot that you have the timeout property node after the VISA write function. Try moving this property node to just after the VISA open function like this. Does this make any difference?

 

I would certainly take on board the suggestions from Wayne.C. Initializing the communications before you run the main loop and then closing them after is good programming practice.

 

 

 

 

Kind Regards

Michael
NIUK Application Engineer
0 Kudos
Message 14 of 18
(2,620 Views)
Solution
Accepted by lizzied

Hi Michael,

 

Thanks for your reply and the link to a similar problem.

 

In my last screenshot, tkafg3k Initialize.vi is part of the instrument driver - I didn't write it. However, I tried

editing it to move the Property Node where Timeout is set to just after VISA Open; it made no difference

to the error.

 

That tkafg3k error Query.vi is buried inside lots of VIs of the instrument driver. I tried removing it from

tkafg3k Initialize.vi and tkafg3k Close.vi but it didn't give me consistent behaviour. For example in my

original post, setting Reset to F works fine, then Reset=T works fine, Reset = F again and I get an error.

So, given that the error has only occurred for me after a particular sequence of VIs

( tkafg3k Default Instrument Setup.vi  followed by tkafg3k Error Query.vi) I have edited tkafg3k Initialize.vi

so that when Reset=F the VI tkafg3k Default Instrument Setup.vi  is NOT run; nothing happens and the next

Error Query VI does not throw back an error. That fix is working fine for me, for now.....

Regards,

Liz

Here is a pic of my modified VI

 

0 Kudos
Message 15 of 18
(2,593 Views)

I found the problem and it IS in the Error Query VI. The problem is in the programmers math. The write functions read 7 bytes, which is 64*2 which equals 128, not 256. 256 is for 8 bytes. These drivers have been a huge pain in my a*** today and last Friday and, thankfully, this was the only fix I've needed THUS FAR. If I rewrite any more code I'll post it here. 

0 Kudos
Message 16 of 18
(2,334 Views)

The screen shot previously attached is not from the AFG 3000 Series driver.  The EVM? query command is usually included in Tek Scope drivers and not FGens.

0 Kudos
Message 17 of 18
(2,313 Views)
Your comment about 7 bytes being 64*2 does not make any sense to me. Nor does saying this in reference to a write function reading something.
0 Kudos
Message 18 of 18
(2,304 Views)