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

Signal Naming Convention (Microprocessor SDK)

LabVIEW 8.6 Microprocessor SDK Help
June 2008

NI Part Number:
372197B-01

»View Product Info

The LabVIEW C Code Generator generates C-style source code comments and variable names from the labels on the block diagram. Underscores ( _ ) replace special characters and spaces.

Use VarNames.vi, located in the labview\CCodeGen directory to set the maximum size of variable names, data type prefix strings, and tunnel name abbreviation strings.

Tip  Keep prefix names and tunnel abbreviation strings short to make comments more readable and to avoid truncated variable names or comments.

The following table shows the LabVIEW signal source and corresponding generated C variable name and comment.

LabVIEW Signal SourceAttribute UsedBlock Diagram ExampleGenerated C Variable NameGenerated C Comment
Front panel controlLabelMotor_On/* Motor On */
ConstantLabelTrigger_Level/* Trigger Level */
FunctionLabel, terminal nameOver_Voltage_x_y__/* Over Voltage: x > y?*/
Loop tunnelSource name, “LT”Trigger_Level_LT/* Trigger Level: Loop Tunnel */
Case selectorSource name, “CS”Relay_CS/* Relay: Case Selector */
Case tunnelStructure Label, “CT”My_Structure_CT/* My Structure: CT */
Shift register (initialized)Source name, “SR”Init_SR, Init_SR_1/* Init: SR */, /* Init: SR 1 */
Shift register (uninitialized)Source name, “SR”Foo_Loop_SR, Foo_Loop_SR_1, Foo_Loop_SR_2/* Foo Loop: SR */, /* Foo Loop: SR 1 */, /* Foo Loop: SR 2 */
Sequence LocalSource name, “SL”Init_SL/* Init: Sequence local */
Sequence tunnelSource name, “ST”Level_Y_ST/* Level Y: ST */
Structure terminalLabel, terminal nameWave_Loop_i/* Wave Loop: i */
Local variableLabel, local variable nameMotor_Control/* Motor Control */
Global variableLabel, global variable namesensors_Temp_1/* sensors: Temp 1 */
User VILabel, terminal nameFilter_Analog/* Filter: Analog */
Note  Generated variables must be unique. If multiple variables have identical names, the LabVIEW C Code Generator appends a sequential number to the end of the variable name to make the name unique.

Resources


 

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