LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unflatten from string

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 variables will solve this problem, but my time is critical and I can wait few weeks.
 
Thanks for your answer(s).
 
PS: Sorry for english mistakes.
0 Kudos
Message 1 of 6
(3,838 Views)
hi there
 
i'd recommend the usage of a FGV (Functional Global Variable aka LV2 Style Global). Search in this Forum for more information about FGV.
 
set the FGV to subroutine priority, then you can use the "Skip subroutine call if busy" (right click the icon on the callers diagramm) in your TCL to maintain determinism.
 
 
 
 
 
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 6
(3,824 Views)

Thanks for reply.

That's a good idea, but I don't want to loose data, so, I can't use FGV.

0 Kudos
Message 3 of 6
(3,814 Views)
Maybe a stupid question: Why don't you extract the attribute from the waveform with the Waveform functions and send it seperately to the Comm. loop? You can just reattach the attributes afterwards to the waveform again. Or am I simplifying things to much? Probably LV freezes up on you because of all the conversions and the memory usage that comes along with it. Regards. JorisV
0 Kudos
Message 4 of 6
(3,773 Views)

hi there

just some thoughts:

- the size of the U8 - Array you created by flattening the waveform to a string varies with the number, the names and the values of the waveform attributes. maybe thats the reason why the unflattening freezes because the FIFO has not enough bytes to hold the whole waveform AND its attributes

- what happens if you write two waveforms to the FIFO before the FIFO has been read out? then the FIFO could contain bytes from  the flattened string of both waveforms which also may cause the unflattening to freeze

if the selection of your attributes is static (i mean you use the same attributes during runtime) i suggest to use a FGV with seperated scalar inputs for the waveform and each attribute (maybe you could bundle the attributes to a cluster), append the inouts inside the FGV and array outputs for all waveforms and all attributes in the FGV. this would call the memory manager, but i think it's worth a try.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 5 of 6
(3,757 Views)
One more question.
Are your waveforms (wfm which has been flattened and unflatten from string type) have the same "Y array representation" property?

Jack
Win XP
LabVIEW 6.1, 7.0, 7.1, LabWindows/ CVI 7.1
Let us speek Russian 🙂
0 Kudos
Message 6 of 6
(3,737 Views)