Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

GenerateSerialOnly Code Generation Attribute (Microprocessor SDK)

LabVIEW 8.6 Microprocessor SDK Help
June 2008

NI Part Number:
372197B-01

»View Product Info

Type: Boolean

Default: FALSE

Determines whether to generate cooperative multitasking code. The default generated C code has the same execution behavior as LabVIEW VIs running under the My Computer target, which runs on Windows. For example, parallel While Loops run in parallel. However, the LabVIEW C Code Generator generates code that uses cooperative multitasking in a single thread. Additional threads are used only by Timed Loops. The generated C code is difficult to read and does not resemble human-written C code.

Set this attribute to TRUE if you do not want to generate the cooperative multitasking code. The code is easier to read and usually runs much faster without the cooperative multitasking code. However, you lose the parallel execution behavior. Parallel While Loops execute in sequence with one While Loop executing only after the other While Loop completely finishes. This execution behavior most closely resembles subroutine priority VIs in LabVIEW Windows VIs. If you set the priority of an individual VI to subroutine on the Execution page on the VI Properties dialog box, the LabVIEW C Code Generator generates C code for serial only execution regardless of the value of GenerateSerialOnly. Setting GenerateSerialOnly to TRUE causes the LabVIEW C Code Generator to generate the C code for all VIs in the VI hierarchy as if all VIs are subroutine priority VIs. The main difference between the subroutine priority setting in the VI Properties dialog box and the GenerateSerialOnly attribute is that subroutine Windows VIs do not allow asynchronous functions. Ordinary VIs that generate C code with GenerateSerialOnly set to TRUE can contain asynchronous functions, which the LabVIEW C Code Generator turns into synchronous functions and does not return to the caller until complete. TCP Read is an example of an asynchronous function.

Note  If you set UseStackVariables or GenerateCFunctionCalls to TRUE, you also must set GenerateSerialOnly to TRUE.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit