06-02-2012 07:54 PM
I´m trying to get waveform data in the memory for the FPGA and it´s not working. For info, i´m working here with a CRIO-9073.
The FPGA.vi is comiled and the RT controller.vi runs. In the attached word doc you will find a better description with pictures of my code.
My problem is that I get NO signals in the FPGA.vi (blockdiagram). For example i press the "read/ write control" button in the RT controller.vi and you can see the changes in the "front panel" of the FPGA.vi but not in the "probe in the blockdiagram". And with the waveform data itself is similar, I can see the data (array with sine points) in probes in the RT controller.vi or in the load.vi, but it does not reach into the FPGA.vi (there in the block diagram, the probes says "not executed").
Has anybody an idea what I have to change?
06-02-2012 09:36 PM
You cannot use probes on compiled FPGA VIs, see "Efficient Development and Debugging with LabVIEW FPGA."
"Absence of typical LabVIEW debugging features in hardware – Once the code is running in hardware – or is hardware – there is no ability to probe, single-step, process highlight, set breakpoints, and more."
I cannot tell from your description whether there is another problem as well, or just that the probes show "not executed." Please do not post Word document attachments: many users do not trust them because they may carry macros with unexpected behavior. While I did open your Word document, I could not follow it. In the future please put the text directly into your forum post along with the images (click the "tree" icon in the forum editor). Also, it is much easier to understand what you are asking when you attach your VIs.
06-03-2012 12:10 AM
thanks for this hints. Ok i got this with the probes, no wonder i can not see anything.
Here in the programm I´m calling a sine waveform from the hosts.vi, the file is saved in "Arbitrary Waveform13.txt"
What I want to do is, writing this waveform in the memory for the FPGA and after read/ get the waveform out (Mod6/ AO0).
But this is not working, I get no signals out of the cRIO.
Well, this time I will post my project and the VI´s in the zip- file.
Hope now it was easier to understand what i need, if not please tell me.
This project is very very important for my thesis and i wasted already too much time.
Thx for any help!
06-03-2012 12:13 PM
I don't have the FPGA toolkit installed on my home machine so I can't run your VI right now, I'll take a look at work tomorrow.
Have you tried running this code in simulation? See "Testing an FPGA VI Called by a Real-Time VI Running in Emulation Mode." That will allow you to use probes and see what your code is doing. Right-click the FPGA target and choose "Execute VI On Development Computer with Simulated IO."
I can't understand what your code is doing; there are a number of things that have no effect and should be removed. Why do you wait for an IRQ to be set, when there is no IRQ in the FPGA code? Why do you execute the FPGA Run method every iteration of the for loop when loading the waveform? (The Run method has no effect when the FPGA VI is already running.) Why is the waveform file unused? What's the point of the while loop that runs 400 iterations and reads a shared variable, but only uses the last value it reads? How do you know that the FPGA has successfully written each value to the memory location? Consider using handshaking with a boolean.
06-04-2012 04:01 AM
thx for your help.
I have not tried to run this code in simulation- emulation mode, but i will try it out on Monday.
Now i placed some indicators in the FPGA.vi and it seems when i read values and scroll through the addresses of the Memory there are values saved.
Well, the waveform are comma values (doubles) but i send integer in the memory, i guess i have to change that.
The values in the addresses until around 399 (waveform consists of 400 vaues) are most 0; 1; and -1, strange is for example address: 49 with value: -8 and
address: 74 with value: 9 Maybe this values were not overwritten, why?
To your questions:
1) First I was not using the IRQ or the run method in the for-loop, but the program did not work so I put this things in, related to the "Arbitrary Waveform" project
I found on the NI side (look new zip- file).
2) What do you mean with "why is the waveform file unused"? If you mean the "read from measurement file" it´s unused because i could not read a file with that,
so I tried to open the file in the Host.vi put it in an array and save it in a shared variable.
3) The point with the while loop, the thing is without any loop there i get the following message: Error -63043 and FPGA disconnects after running for a few seconds
check this out, i was already asking for that problem: just google: Error "-63043": FPGA disconnects after running for a few seconds
the 9th and 10th reply are mine!
The thing is I could solve this error -63043 problem by placing this while loop there (but I need a wait- function).
It´s true it takes just "the last value" but if i see this correct there is not one value sent, there is an array sent with all 400 values.
And the function of that while loop is just to delay, before sending the values to the load SubVi. As i told you without this while loop, this error -63043 occurs
and I loose connection. Maybe there is another option to avoid this error? You can change the wait function value to 100 and it avoids the error as well,
I don´t know what the limit is.
4) I don´t know for sure that the FPGA has successfully written each value to the memory location.
I placed indicators there, but because of the integer i was not able to check every value. I will try it on Monday. But what is the best method to find this out?
If the method is this "handshake with a boolean" , I have to try it out. (I don´t know how this works).
Is there also an 2010 version available? https://decibel.ni.com/content/docs/DOC-19430
I´m looking forward to get your response.
06-04-2012 03:56 PM
It's not a good idea to copy random pieces of code without understanding what they do in the hopes that they'll fix a problem. Waiting for the IRQ is useless since you never set that IRQ on the FPGA. If this does somehow fix your problem, it's only because it's causing the code to wait for the timeout, and could be replaced with a simple wait instead.
Are you now using the project you uploaded with your most recent message, and I should ignore the previous one? Are you still getting the -63043 error, and if so, from what function? Please include the full text of the error message.
There's still no need to call the FPGA Run method everywhere.
The concept of handshaking is exactly the same for LabVIEW 2010 (and previous versions). You can write it yourself trivially. The idea is that you have one or more numeric controls and a boolean. On the host side, write to the numeric controls (in your code, this might be the address and the value). Then set the boolean to true. On the FPGA, wait for the boolean to be true. When it is, read the address and value from the controls, write to the memory location, and set the boolean to false. On the host side, wait until the boolean is false before writing the next value.
06-04-2012 05:44 PM
Ok i got it, no IRQ and no run- function in the for-loop. No, I´m NOT using Generation_Arbitrary waveform, it was only to show you where I got this ideas from!
I´m still using the very first one and please don´t ignore all what I wrote. How I said at point 3) I get this error -63043 when I do not place a while loop there.
Without while loop I get this error again (I already tried it out). But as i was saying maybe there is another option to avoid this error?
Ok this is the exact error message (appears without while loop in the RT controller.vi):
1. Warning: Connection to the Real-Time target (Mesa4) has been lost.
2. LabVIEW FPGA called another software component, and that component returned the following error:
Error Code: -63043
NI-RIO: (Hex 0xFFFF09BD) The session is invalid. The target may have reset or been rebooted. Check the network connection and retry the
Well, I really loose connection to the cRIO and have to restart the cRIO. Before the message appears I compile/ run the FPGA.vi and when I
run the RT controller.vi after a view seconds this error message appears and then the yellow status LED on the cRIO starts to blink 3 times in a row.
But let us focus again for the main problem:
I need a waveform of points in the memory for the FPGA and I need to get this signal out (This is only the first step of a lot of things I still have to do and I´m running out of time).
JUST FOR YOUR INFORMATION:
The assignment is to control an induction machine via a converter. The converter consists of 6 IGBT´s and they have to be controlled with PWM signals.
For getting this PWM signals (I alredy did it in the scanengine mode- was not the problem), the problem is here with the FPGA and my professor says I need to do it in the FPGA, but it´s true in the end I need a higher frequency then 1000 Hz) I will use the comparison between a sinewave and a triangle signal. I already tried using generators or building functions to get this waveform signals in real time and I got more and more problems. The way my professor recommends and I decided for is, to use lists with fixed points, that´s why I try to load a list of points (the waveform) in the memory for the FPGA. But of course the induction machine is three phase, so I need the sine and triangle waveform with 0°; -120° and -240°, also I need per per half sineperiode different amount of pulses of the triangle wave. For example at sine: 1 Hz I need a triangle signal with 1; 3; 5; 7; 9 impulses. So in a range of 1 until 60 Hz considered 9 impulses (should be a frequency of 19 Hz) it´s 60 Hz*19 Hz = 1140 Hz. Ok so beside the phaseshift and the frequency i need the amplitude adjustable (no problem) but also i need a delay for all IGBT signals always when the change the value from Low to High. This delay is 1 usec, so I need to do it in the FPGA.
1. Step: How can I get this waveforms into the memory for the FPGA and how do i get this signals out of the memory?
2. What do you mean with "why is the waveform file unused"? If you mean the "read from measurement file" it´s unused because i could not read a file with that,
so I tried to open the file in the Host.vi put it in an array and save it in a shared variable.
3. What about this"read from measurement file", how does it work?
4. What do i have to change in my code to get it work?
5.nathand, are you from NI or a private person?
Thank you for your help.
06-04-2012 08:13 PM
I don't know about the -63043 error. I assume you've already checked your firewall as suggested in the thread about that error. Does it still work if you simply put a wait - no while loop, no read from the shared variable - in place of the while loop? Do you get an error out of the network shared variable read?
1. Try using the handshaking approach as I suggested. You can test this running directly on the FPGA with no host VI needed, just interact with the FPGA VI front panel. You can add the cRIO FPGA as a target under My Computer, even though it's actually part of a remote cRIO system. Using the front panel of the FPGA VI you can try writing values to the memory and then reading them back. Then you'll need to add some FPGA logic to iterate through the memory locations.
2. You did not include any VI in your zip file that actually loads the waveform. There's a reference to "hosts.vi" in the project, but it's not in the zip archive. So, I can't see how you're using it the waveform file.
3. Try reading the help for this function, or write a little VI to run on your computer that uses it and test it out? I'm not sure what you mean by, "how does it work?"
4. Have you run your code in simulation yet? You will probably need to make several changes to your code. The Arbitrary Waveform Generation example is a good start but has some errors, looks like it was written for an older version of LabVIEW and some features have changed.
5. I am not an NI employee.
06-04-2012 08:33 PM
Ok, this VI was missing, here you go: attachment
I will check it out what you mentioned.
But if you have more ideas just let me know.