06-23-2009 09:27 AM
I'm trying to test a PID (FPGA) vi in a statechart built to run on the FPGA, but its giving me the following error. Am I missing something, or does the PID (FPGA) really not work when you use it in an FPGA statechart?
Thanks
Solved! Go to Solution.
06-23-2009 09:45 AM
06-23-2009 09:57 AM
I'm not sure I understand your question correctly, but i'll tell you what I tried.
So I placed the statechart under the FPGA resource in the LV Project, and set it to execute on the FPGA. When I edit the statechart, in the lower left bar it tells me that its set to run under FPGA (Dev Computer), and everything works when I remove the FPGA. When I accidently tried to wire a double as an input to the statechart, it setna warning saying that the double type wasn't allowed for this target (which is good for an FPGA target), so I think its considering the statechart to be run under the FPGA. The Server:localhost message that we see on the bottom left only comes up when I open a statechart action to edit, but when I close it, it returns to displaying the FPGA (Dev computer)
I also tried copying the statechart directly to my Host vi to see if the PID(FPGA) would give the same error there, but it actually seems to work fine on a host VI.. so.. I'm a bit lost.
There are some other weird things i'm noticing using the statechart on an FPGA which seem like they might be bugs (such as when I try to build an array in a statechart action it errors saying that the arrays need to be of fixed sized. On an FPGA vi you typically have the option to preallocate the array size, but in the statechart, I don't see any similar option), but i'll post about that seperately.
So I don't know if I answered your question.. and I'm still lost =P
Thanks
06-23-2009 11:43 AM
That is odd... I'm looking into it (I didn't have a machine handy with the PID stuff installed so I'm having to get that set up in the background).
As for the preallocated array size, etc, there is actually a setting in the properties tab of the configuration dialog that will let you turn this on. There is a known issue though where this sometimes will not take effect - to ensure it does make sure you modify your guard and action before hitting OK on the configuration dialog (any modification, such as a cosmetic/movement operation, will do the trick).
I'll let you know what I see with PID once I get set up.
06-23-2009 02:50 PM
Ok, so it turns out this is a confusing error message/situation. It actually is tied to the autopreallocate setting. If you drop PID (FPGA) on a regular VI in an FPGA target and disable autopreallocation, the VI will break with the same error message.
So to use PID in your statechart guard/action, go to the properties tab in the configuration dialog, check the autopreallocate option, and drop PID. LV will still show the error because we don't change the autopreallocate setting until you hit OK. If you open up the configuration dialog again, the "not supported on Target" error should be gone.
Hope this helps.
- Nick
06-23-2009 03:21 PM
Ah-hahh... So it looks like that fixes both problems. That was extremely tricky, subtle, and not at all intuitive. Good find! It took me a while to click and close the diagrams correctly for all the releevant states and superstates, but now it works. Hopefully we'll see NI correct or clarify this behavior though for future versions.
Thanks alot Nick!
06-23-2009 03:58 PM