![]()
|
|
|
REFERENCES : LABVIEW LabVIEW example: virtual instruments Now it is time to see how to create virtual instrument and use it in another virtual instruments. One suggestion is shown on the pictures below.
First picture shows "false" condition. At if loop entrance, input value is checked. If it is not less than 0, than initial value of factorial is set on 1, for loop is executed up to input value, and result shows at the exit. If loop also contains string constant with message that the operation has been done successfully. Second picture shows "true" condition, it prints warning and returns 0 as a result. Next step is creating an icon with one input and two outputs, one for result and one for message. LabVIEW offers its own tool for icon drawing. Now it is possible to create new virtual instrument that will contain created virtual instrument for factorial calculating. Crated virtual instrument is shown as square with "N!" on it.
If you double click on virtual instrument, front panel for that instrument will be opened in block diagram. If you drag mouse arrow on created instrument and hold together ROMB and H (SPARC keyboard) or Ctrl+H Help window for that virtual instrument will be shown.
Program is limited with word length for result (32 bits for integers), so errors like one that follows can be expected.
Introduction to G programming language Please, send your comments or suggestions to: Armin.Stranjak@fer.hr
Copyright 1997. RASIP - Computer Systems and Processes. |
|