FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

exchange data between loops

Hello everybody,

I develope a [c]FP application and I've running two parallel loops. In the first loop I sample data (temperatures) with 1Hz. After 24h I produce a file with histogram datas, wich I want to send via FTP to a server. This function is placed within the second loop inside a case structure. The case structure must be set to true if a boolean value in the first loop is set to true.
I using global variables to exchange the boolean value between the loop. It works fine aslong I work in the developing mode. When I build a new startup exe and let the [c]FP standalone, it doesn't works anymore.
Is there a better way to exchange datas between loops without using local or global variables?

Thanks for your help.

Thomas
Thomas
0 Kudos
Message 1 of 6
(3,775 Views)
There shouldn't be any difference in the behaviour of a local or gloabal variable between the development environment and the executable. The problem is most likely due to something else which doesn't run well in the exe. There are ways of troubleshooting this. First, was the EXE set to run when the module loads? Second, When you say it worked, did you run it on the PC or the cFP? If it was from the PC, try running it from the cFP and see if it works. If not, download your application to the unit, use an FTP server (There's one in MAX - right click on the unit under remote systems and select File Transfer) to copy C:\ni-rt\startup\startup.exe to the same directory on your HD. Now, when you connect to the cFP using LV, you'll see the front panel of the running app and you can use it to see where the error is.
Last thing, when exchanging data between loops, a local would be enough - a global is used to move data between different VIs. For a boolean trigger, a local variable should be enough, but you should take a look in the Advanced>>Synchronization palette. There you have functions which are designed for these things, like queues and notifiers. Using them, you could have the loop running only once every 24 hours.

___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(3,772 Views)
Hi,

thanks for the response.
At first, yes the modul was set to run from startup.
Second. I'm always connected to the [c]FP target and after the build action the new startup.exe was placed to the [c]FP. After I reset the [c]FP a LED was flashing from my sample loop.
When I using local vars. The appl builder throws messages that he can not resolve the local vars or something like this. When the appl builder replace the local vars with FIFO, the connection to the consumer vi's are lost.
That's why I'm using global vars. I want to use Queue operations but I don't know how I can work it out, because I using LabView sence 4 month. This vi's are very special for me.
Maybe you have a simple example to use this.

Thomas
Thomas
0 Kudos
Message 3 of 6
(3,770 Views)


@TomDooley wrote:
Hi,

When I using local vars. The appl builder throws messages that he can not resolve the local vars or something like this. When the appl builder replace the local vars with FIFO, the connection to the consumer vi's are lost.

Thomas




What? What messages? You're saying the App builder replaces your code? Must be a mutated app builder. Please elaborate more on the messages and about what the app builder does exactly, and if your code is small enough, post it here.
To find examples, click Help>>Find Examples and search for queue. You can also search this site for queue tutorials. Here's an example of one.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(3,765 Views)
Thomas,

to exchange data between two loops I recommend the queue vis you can find under advanced-synchronization-queue.
Have a look at the examples (producer-consumer structure)
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 6
(3,753 Views)
Hi guys,

thanks everybody for the support. Now I'm using notification vi's and it works wonderfully.

Hear you soon.

Thomas
Thomas
0 Kudos
Message 6 of 6
(3,748 Views)