preface

These are my online notes on the LabView course 07.09.2005. Typing errors are ment to be fun for the reader. The Linux installation at the course room is because of the network installation as slow as the computers used to be 7 years ago. At least;-)

preperation

Linux:

My .profiles adons:

echo /usr/local/labview/labviewlogin
. /usr/local/labview/labviewlogin
echo

echo export=DIM_DNS_NODE=lxgs11.gsi.de

export=DIM_DNS_NODE=lxgs11.gsi.de

CS is useing DIM for communication.

Click Tools->Options in order to change the options. Be aware of the search paths. An the presets, like: the tool pallete with a right click in the block diagram.

help is much better under windows than Linux!

keyboard stuff

Alt+e in the Front Panel gives the Block Diagram
Alt+w close window
Alt+h get Context help, works on wires too

SPACE: toggle between wireing tool and others...

Course points

Lesson 1

Data flow and variables

Remember: Data flow concept. (check the VIs in Holger's Lesson 1)

Use sequence structrures only when needed. Local variables are initialised to zero (may be not default but experience).

In order to crate data dependencies one possibility are functional global variables.

Local cvariables are not forbidden but: be aware of the consequences. One usage could be for a GUI where the time is NOT critical.

State machine example! Traffic light (as allways;-))!
  • Front Panel has lower priority as the the Block Diagram
  • right klick FP-> advanced -> Synchrinious Display

online help

Context help. Very important for subVIs

Top left corner (small pic) right click-> VI Properties -> Category (Documentation). Type the help which should be shown as online help. Tool tip.

On the individual Control: right click-> Properties -> Documentation. Same thing for individual controls.

Note: these things are propagated to upper layers of calling VIs if the VI is made public with crate control...

Shif register are statics (for the C programmer)

subVI

Main topic: how to integrate an propagate errors.

Range checking BEFORE the execution of the algorithm.

Eror handling the error is checkt first! (Convention!!!)

If error nothing should be done. (Passing the error to the error handler at the end.)

How to Description! Useable, readable, meaningful Names!

Important give the source of the error Error Codes: find in Help Codes: 5000 to 9999 User Codes.

(periodic) Events, Jitter & CPU time usage

Jitter measurement VI very instructive!!!

Delay not smaller than the algotithm tim in the loop.

Example VIs: Dataflow Loop Metronom.vi
Dataflow Loop Metronom mit Jitter.vi

Jitter is always connected to the timing issue and therefore needs to be taken seriously. In other words the requests of the control setup need to be considered.

Realtime meens NOT necesseraly fast.

Since LabView 6.0 event driven procedures are possible.

See example VIs

Lesson 2

Multi-Threading Occurrence, Master-Slave

In order to disentangle GUI from the rest. Concept: GUI event loop Periotic loop

Occurencies....

Control of to loops possible with occurenceies.

A VI runs til the end of the LAST loop is reached.

Events should be transferred but now data? No Occurencies are the method to propagate

Custemize Window Appearence in the properties of a Front Panel is importasnt.

Multi-Threading Notification, Publisher-Subscriber

Notifier: unbuffered Queues: buffered!!!

again nice examples

This is now the propagation od DATA.(Notifiers?) Release notifier is important to close memory leaks in theuser application.

Multi-Threading Queue, Producer-Consumer

Queues: typical usage if something needs to be serialised AND all data must be processed, use a queue. With queues you ensure to get ALL data. Queue depth is not previously defined (-1, unlimited). By creating a queue one can set the depth.

Last VI example some data conversion.

Flaten string can be used to send any kind of complex data. First convert to string then back to original data type.

Note: The CS is using this mechanism (Flaten string of flaten strings) with this one is done in terms of eventual data mismatches...

Multi-Threading Synchronization with Rendezvous and Semaphore

In order to synchronize events the method of rondevous was demonstrated. synchron start! (note the time of the three loops)

Semaphore 1: only one is allowed to acces.... This gives the exclusivity of a resource i.e..

CS uses semphores to guarantee the exclusivity of ressources. Semaphores are time expensive... (in term of CPU time...)

Reentrant VIs

Standard is: Not Reentrant

At runtime new instances! Vi properties-> Execution -> Reentrant execution

Why needed: same VI for different interfaces. If not reentrant it's blocked.

All VIs which could be used twice ARE reentrant in the CS.

Lesson 3

Instrument Driver

"no dialog" important. There shouldn't be some random popups initiated by the driver. The error should be propageted.

Visa is a middle layer. The way to connect to external devices.

The NatInst driver example is not a "good" one.

Good example:

VISA lock is buggy therefore use semaphore to lock.

VI hierachy: Browse-> Show VI hierachy

command under linux: visaconf gives the visa setting.

Lesson 4

VI server methods

Property nodes

remote procedure calls...

-- MarcRStockmeier - 07 Sep 2005
Topic revision: r2 - 2005-09-07, MarcRStockmeier
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)