Jump to content

Using Unflatten from string on PXI


Nico

Recommended Posts

Hello,

I have problem with "unflatten from string" function. :(

As you can see in the following picture, LV application freezes on UFS execution.

I'm using this function to pass waveform with attributes from time critical loop to communication loop. RT FIFO doesn't allow to pass atribbutes with waveform, so, I have to use this complicated way waveform->binary string->U8[] FIFO->binary string->waveform. It works when 2 threads write in FIFO, and, when I add a third one, LV RT freezes, and I have to reboot (or reset) PXI controller. More details: Wfm contains 1000 elements in Y array. FIFO= 100 * U8[10000].

Have you some idea to solve this problem or to use an other waay for WFM with attribute?

Maybe LV8 and its shared vriables will solve this problem, but my time is critical and I can wait few weeks. :headbang:

Thanks for your answer(s).

PS: Sorry for english mistakes.

post-3044-1128510756.jpg?width=400

Link to comment
I have problem with "unflatten from string" function. :(

As you can see in the following picture, LV application freezes on UFS execution.

I'm using this function to pass waveform with attributes from time critical loop to communication loop. RT FIFO doesn't allow to pass atribbutes with waveform, so, I have to use this complicated way waveform->binary string->U8[] FIFO->binary string->waveform. It works when 2 threads write in FIFO, and, when I add a third one, LV RT freezes, and I have to reboot (or reset) PXI controller. More details: Wfm contains 1000 elements in Y array. FIFO= 100 * U8[10000].

Nico,

Are the three threads writing to a single FIFO simutaneously? If so, are you sure that the FIFO information is not getting shuffled - not unlike shuffling three decks of cards. I just checked and the RT FIFO call is reentrant, so if you have three simultaneously running processes writing to one FIFO, I think it is possible that they "walk" all over each others data, making a garbled mess that your "unflatten from string" might have problems dealing with. It is possible that when you had two processes, somehow they were never writing to the FIFO "over top" of each other, and adding the third has started to do so.

If the above is the case, then maybe you really want the three processes to write to independant FIFOs, and then you sort them at your processing side.

Hope this helps,

-Pete Liiva

Link to comment

Nico,

Assuming that nothing is getting confused as to which FIFO is which, you may want to step back and perhaps make sure that what you put into each FIFO is what you get out. You could, for the sake of debuging, write the U8 arrays straight to disk files (probably one file for each individual FIFO) during the writing process, and write the U8 arrays straight to disk at the reading process (again one for each individual FIFO), and verify that you have data continuity by comparing the "input" vs. "output" disk files. Make sure to take out the "Unflatten from String" so that it doesn't hangup the operation. If the FIFO's are doing there job properly, the input and output array files for each FIFO should be exactly identical. I still kind of think that the "Unflatten from String" is getting values that don't make sense to it for some reason, and this is the first way that comes to my head to debug the situation.

-Pete Liiva

Link to comment

Now, this problem is solved.

The reason is a wrong definition fo the Y array representation. In a writing sub vi, it was extended precision, and in reader vi, it was double. So the unflatten from string function freezed. I use double everywhere and it works nice.

Thanks for your help.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.