09-13-2012 03:54 PM
So I followed the FPGA Personality Example for varying frequency and duty cycle (https://decibel.ni.com/content/docs/DOC-16699) to do the same thing in my program. I need all my channels to vary and I have 56 channels so I basically took the idea behind the original PWM out and stuck four of them into one subVI. I also grouped my packets as one U32 for frequency and one U32 for duty cycle in the same U64 packet rather than having just frequency's in a packet and just duty cycle's in a packet. I didn't put the time loops inside the main while loop either. I kept them on the outside of the frame like the VeriStand FPGA Wizard sets it up.
I had it working before with VeriStand FPGA based I/O tools but needed to be able to adjust frequency and not just duty cycle so I turned to this. I cannot get it working and cannot figure out why it doesn't work. I have included a copy of my subVI and a screen of one of the packets in the XML file. Any input would be appreciated, thank you.
09-14-2012 03:36 PM
Can you post the top level VI? the subVI looks fine. Also, what hardware are you using?
09-17-2012 08:01 AM
Here is a screenshot of a portion of the top level VI (you can't see all the channel loops but it's just a copy/paste type thing). The first 11 packets are for a quadrature output so that can be ignored for this. The packets for the PWM are the last for loop of packets (56 total). The subVI with the blue top and "4 CH. PWM GEN" is what I posted earlier. I am using a PXI-7813R FPGA for this and it is connected to a C-series chassis with 9474 modules in it. Thanks for the help.
09-17-2012 09:05 AM
I dont see anything obviously wrong. Couple of things you can check:
09-17-2012 09:35 AM
I appreciate the help.
The only reason there is 8 in the second for loop is because of the way the .fpgaconfig file is right now. It will not be there when I am finished; it is temporary. I didn't want to delete a portion of my .fpgaconfig file if I will still need it.
My .fpgaconfig file does much the 1 packet for read and 68 for write.
I was hoping when you mentioned the last one that, that would be it but I had changed it before to 1023 just to make sure I wouldn't have any problems with that.
I'm not sure why it's not working. Would it make a difference it it's not in a timed loop?
09-17-2012 10:10 AM
Rats...
Yes you need the timed loop because of the way the PWM generation express VI works. It does a point by point generation which is best suited for your hardware since it has fast digital lines.
What symptoms do you see? Do you see nothing output on the digital lines at all?
One thing you can do to debug is connect to the FPGA VI remotely while it is running, so you can see its front panel.
09-17-2012 01:48 PM - edited 09-17-2012 01:49 PM
Wow... all this trouble and I feel a little dumb for a lack of better words. Turns out I had the 32-bit part of my packets mixed up in my config file - frequency was duty cycle and duty cycle was frequency. It seems to be working now testing it by viewing the front panel. I will check it with a scope later this afternoon.
Thanks for the help with this.
09-17-2012 01:52 PM
Woohoo. Glad you figured it out 🙂
09-18-2012 08:55 AM
So, a question about your method of debugging using the front panel.
I am trying to view the front panel of my FPGA while running my VeriStand project to verify that some of the quadrature components I'm implementing are working before doing a hardware test and I keep getting an error. I had it working just fine earlier, but realized that I had something wired wrong so I changed it, recompiled, and now I get an error that reads:
"The operation could not be performed because the FPGA is busy operating in FPGA Interface C API mode. Stop all activities on the FPGA before requesting this operation."
This error comes up after I deply my VS project and hit the run button on the front panel. If I undeploy my VS project and try to run the front panel the error disappears. Any idea why this error would suddently start appearing after recompiling?
09-18-2012 09:32 AM
The NIVS engine does access the FPGA via the C interface... but I've never had this problem before. You should be able to simultanously access it remotely from LV on your host computer and while the NIVS engine accesses it on an RT machine.
That brings up a good point - ive never tried this trick when the NIVS engine was running on windows. Is that what you're doing? Perhaps that is not supported...