09-29-2006 04:48 PM
10-02-2006
02:27 PM
- last edited on
10-02-2025
01:14 PM
by
Content Cleaner
kehander,
First, please take a look here. It is a link that talks about Shared Variables and the different ways that you can use them. I looked over your code, but would like for you to isolate it down to the bare minimum that demonstrates the issue that you are trying to fix. Also, it is a very good idea to limit the block diagram to one screen, this makes it easier for someone else to follow what your VI is doing. I don't think that you need to write the default values to the shared variables. I would recommend troubleshooting your application further to see where you are getting the -1950678981 error. Have you tried using highlight execution?
As far as your last question, look here. It talks about using VI server. Let us know when you have reduced your code to the most simple example.
Thanks,
Nathan
10-02-2006 02:42 PM
10-02-2006 03:25 PM
10-03-2006 02:03 PM
I hope I'm not trying to tackle too many issues for a single thread here, but it seems to me that VI Server cannot be used in this case. Specifically, I've tried to implement this with Read Data Trisample, only to be informed that the VI is broken when I try to call it.
If I copy the VI to the PXI's hard drive, then the copy is no longer part of the project and can no longer access the same shared variables, even if I copy Fulcrum Variables.lvlib as well, right?
10-03-2006 06:56 PM
10-04-2006 12:26 PM
I've done some further analysis and have come to realize that my "Ready?" boolean should not be a buffer, since it is meant to store a single value indefinitely and is the cause of at least some cases of the read buffer overflow errors. I'm still trying to figure out some of the other problems, though.
I notice in the Shared Variable Manager that Mean Array, Measurement Array, and Params are listed as having types of DBL Array, DBL Array, and Custom, respectively, but in the project their types are stated to be DBL Array, Custom, and I8 Array. Is this behavior expected?
10-04-2006
09:28 PM
- last edited on
10-02-2025
01:15 PM
by
Content Cleaner
Kehander,
To avoid an overflow or underflow on your buffered shared variables, the average speed of the reads and average speed of the writes must be close to equal. Look into how you can adjust the read or write speed to even things out. The reason that putting delays in part of your code works is that it is slowing that part of the VI down. Delays are not a bad thing, they allow the loop to go to "sleep" and allow other threads to use the processor. This is especially important in RT systems.
Did you have a chance to read all of Using the LabVIEW Shared Variable? It is very informative. Another good link is Deploying and Launching a Real-Time Application. The part that is especially useful to you is the second method of launching the executable. It uses VI server. Read over it and let me know if you have any specific questions.
Once deploying the VI to the PXI, it will still recognize the shared variables. If you can run the VI from the project on the RT PXI, then you should not have any problems turning it into an executable, deploying it, and then launching it programmtically. I see the difference in Variable data type labels that you wrote about and I would not worry about it as long as they are not having data type conflicts.
Take care,
NathanT
10-04-2006 10:01 PM - edited 10-04-2006 10:01 PM
Message Edited by kehander on 10-04-2006 10:03 PM
10-05-2006 01:55 PM
I have experimented a little more and found that quite frequently, the Host PC reads the Mean Array shared variable before the PXI has a chance to write to it, which explains that spurious zero value (and also severely messes up the data I'm trying to collect).
Why does this happen?! I set up the Ready boolean for the express purpose of keeping this from happening! Is there a better way of keeping the Host PC from taking the reading before the PXI is ready?