Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

1. Local variable does not work with latch…….

2. Global variables can contain more than 1 data types because you can select item from menu.

Uses of Local Variables


1. To use the same block at multiple positions in block diagram (initialize)
2. Write to controls
3. Parallel processing because using wire, it is not possible.

Drawbacks of Local Variables


1. Less readable block diagram
2. Less mechanical actions
3. Slow performance
4. Race conditions (when you are writing to the same local variable)

Race Condition:
Reasons:
1. Multiple reader/writers at same time (two tasks have same access)
2. Execute multiple tasks in parallel
3. Share value between two parallel tasks using local variable

Avoidance:
1. Less use of variables
2. Sequential logic
3. Control shared resources

Why Use Parallel Loops???????


1. Perform tasks simultaneously
2. Perform tasks at different rates

Queues:

You might also like