LabVIEW LEGO MINDSTORMS NXT Module Programming Guide Manual

LabVIEW LEGO MINDSTORMS NXT Module Programming Guide Manual
Pages 97
Views 746
Downloads : 2 times
PDF Size : 572.7 KiB

Summary of Contents

LabVIEW LEGO MINDSTORMS NXT Module Programming Guide Manual

  • Chapter 2Extensions to LabVIEW© National Instruments Corporation2-77LabVIEW LEGO MINDSTORMS NXT ModuleUsing Dynamic System CallsDynamic system calls are custom functions that you create in the NXT firmware.NoteWhen you create a dynamic system call, ensure the ID of the system call is unique.You can create system-level methods that access dynamic system calls from an NXT VI. You then can use the NXTDynamicSyscall refnum to expose these methods.You must update the NXT firmware to support the dynamic system call and build a new firmware image before you can access the system call from an NXT VI.Creating Access to a Dynamic System CallComplete the following steps to create access to a dynamic system call.1.Create a .rc file that defines the system-level method with which you want to access the dynamic system call.2.Save the .rc file in the labview\resource\objmgr directory. The name of the .rc file must begin with NXT.3.Create a VI that outputs the data type and default return value of the dynamic system call as a LabVIEW variant data type. The module compiler uses this VI to determine the data to send to the dynamic system call in the firmware.4.Select the 4 × 2 × 2 × 4 connector pane pattern for the VI. Refer to the LabVIEW Help, available by selecting Help»Search the LabVIEW Help, for information about building connector panes.5.Assign the top-right terminal of the connector pane to the variant output, as shown at left.6.Save the VI in the labview\vi.lib\addons\NXTModule\DynamicSystemCalls directory. The name of the VI must be the same as the name of the system-level method you created.