LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Function Generator for 6i (v8.0 equivalent)

Hey Guys,
I am currently in the process of converting a program from v8.0 to versin 6i. I had to write the program with the evaluation version until I could get a copy of our licenced software.

I believe I have sucesfully re-written the program code to work in 6i and it seems to work well.

When I was testing with version 8 I was using the Function Generator.vi to produce a signal on AO1. I then had wires connected from AO1 to AI 6. This allowed me to output with one program and read with my program.

Is there a similar VI for 6i? I have tried to use "Simple AO Function Generator.vi" but the format of the program is strange and I can not get it to output on the channel.

I have tried recreating the Function Generator.vi in 6i. This is attached. When I run it though i am getting an error with the AO Clock Config.vi

Any help either finding a vi that will easily produce a sine or square wave to AO0 or fixes with the recreated function generator would be greatly appreciated.

Thanks
Christian
Download All
0 Kudos
Message 1 of 9
(2,835 Views)
Christian,

I do not have any hardware so I cannot test your VI. Should the AO Clock Config VI come before the Write AO? From the help files it appears that Write AO writes to a buffer and that Config configures the clock for that buffer. Exactly what error are you getting?

Lynn
0 Kudos
Message 2 of 9
(2,829 Views)
Lynn,

Unfortunatley I do not know much about how to write information to the board and am just using an example.

I had been using Function Generator.vi for version 8.0 from the example library. Since I could not open this VI in 6i I recreated it by hand. What I posted is exactly how the one from version 8 is set up.

Attached is the error that I am receiving. The funny thing is that the error is with AI Clock Config, and as far as I know I am not using this vi. I should only be using AO Clock Config....

Thanks
Christian
0 Kudos
Message 3 of 9
(2,825 Views)
I just went through all of the subvi's and AI Clock Config is not anywhere. I am not even sure why the program is referencing it. If I goto print and look at the hierarchy it references several AI* vi's


0 Kudos
Message 4 of 9
(2,823 Views)
Put probes on the error cluster wires between each of the VIs. This will show exactly where the error first occurs. When I run AO Clock Config it generates an AO error.

I just looked at your VI again. I think I see what may be a problem. The AO Clock Config VI has a "clock" input. It is an enum or ring with numerical representation of U16. The possible values are 0..3: no change, update clock 1, interval clock 1, and update clock 2. You are feeding it a Single (Update Rate) with a value of 4000. Try changing that to 0 and see what happens. There is a cluster called "alternate rate set" which may allow you to set the rate you want. Read the help for definitions of the controls.

Lynn
0 Kudos
Message 5 of 9
(2,813 Views)
I believe I found the error.

On the true pane of the largest case structure I messed up and used AI Start instead of AO start. AI Start contains AI Clock Config and this is what was throwing everything off and where the error was comming from.

I am now receiving the same error form the following location:

Main vi -> AO Start on true Pane -> AO Clock Config.

When I run the same VI on both versions they both have the same result. Only when I run the entire program will it work on verison 8 but not version 6i
0 Kudos
Message 6 of 9
(2,809 Views)
After checking some more it seems that the problem is in the AO Clock Config.

I am testing both version 8.0 and 6i next to each other. The inputs to the call library function between the two programs are excactly the same but for some reason in 8.0 the wire going to the error section outputs 0 and in 6i it outputs some strange number causing the error.

I have tried copying the version 8 dll file (lvdaq.dll) into the verision 6i and the same error occurs.

Can anyone tell me why the call library function would output 2 different values depending on the version of the program even if the dll that the call library is referenced to is exactly the same?

The original DLL is at:C:\Program Files\National Instruments\LabVIEW 6\vi.lib\Daq\lvdaq.dll
I replaced this with the one from version 8, the one that works and still no good.
0 Kudos
Message 7 of 9
(2,804 Views)
Correction:

I found one difference between the working version and non working version.

In the non working version, when the program reaches the AO Clock Config, the task ID is not getting passed to the VI, it is using a task ID of 0 when it should be 33554433 (from other program)

Ideas?

thanks
Christian
0 Kudos
Message 8 of 9
(2,803 Views)
PROBLEM SOLVED

Thanks
0 Kudos
Message 9 of 9
(2,801 Views)