Communicating among Multiple Loops
Main Page
A) Variables
B) Race Condition
C) Synchronizing Data transfer
Sample Questions:
1) Which data synchronization mechanism ensures that no data is lost when an application temporarily provides data faster than it is able to process it?
1) Which data synchronization mechanism ensures that no data is lost when an application temporarily provides data faster than it is able to process it?
a) Notifier
b) Queue
c) Semaphore
d) Local Variable
2) Which of the following cannot be used to transfer data?
a) Semaphores
b) Queues
c) Notifiers
d) Local variables
3) How long does this Dequeue Element function wait to receive data?
a) 1 millisecond (default since unwired)
b) 1 second (default since unwired)
c) Indefinitely
d) It does not wait, it returns immediately
4) Which of the following illustrates an advantage of a global variable over a local variable?
a) A global variable can pass data between two independent VIs running simultaneously
b) Only the global variable can pass array data, local variables cannot
c) Global variables follow the dataflow model, and therefore cannot cause race conditions
d) Global variables do not require owned labels to operate
5) After a VI finishes using a notifier, it should be released.
a) True
b) False
6) Which function creates a notifier?
a) Release notifier
b) Send notifier
c) Obtain notifier
d) Wait on notification
7) What is a common design pattern that uses a notifier?
a) State mechine
b) Master\slave
c) Producer\consumer
d) None of the above
8) When using notifiers it is possible that data will be overwritten and lost.
a) True
b) False
9) What is an advantage of using notifiers over variables in a master/slave design pattern?
a) Can help eliminate race condition possibilities
b) Notifiers transfer data more quickly than variables
c) The slave loops can notify the master loop upon user input
d) The notifiers allow data to be passed between parallel loops
10) Which queue function defines the size of the queue?
a) Obtain Queue
b) Enqueue Element
c) Dequeue Element
d) Release Queue
11) By default, the queue size is unlimited. Therefore it can store an unlimited amount of data.
a) True
b) False
12) When the producer loop sends data faster than the consumer loop can read them, queues store the data to be read when the consumer loop is available.
a) True
b) False
13) In the producer/consumer design patterns, what queue function does the producer loop use to send a notification to the consumer loops?
a) Obtain queue
b) Enqueue Element
c) Dequeue Element
d) Release Queue
14) What advantage does using queues have over using notifiers?
a) Vis can process all data placed I queue
b) Queues can store multiple pieces of data
c) Data can be lost in some situation when using notifiers
d) All of the above
15) Notifiers are a tool for communicating between two independent parts of a block diagram or between two VIs running on the_______.
a) VI Server
b) same machine
c) Different Machines
d) None of the above
16) Notifiers cannot communicate across___________
a) networks or the VI Server
b) Same VI
c) Multiple loops in VIs
d) Multiple Vis
e) None of the above
17) This communication is generally for the purpose of synchronizing two independent processes.
a) Notifies
b) Shift registers
c) Case Structure
d) None of the above
18) Notifiers are similar to mailboxes for data: one process sends data to the mailbox and another process receives data from the mailbox. In this way they are similar to local or global variables. When using a variable, however, the process that is waiting for information must cycle continuously to check the value of the variable. One benefit of notifiers is that the process that receives information completely stops execution while waiting, and starts again only when new data becomes available. This cuts down on computer time wasted on endless polling.
19) the Notifier Operations functions do not buffer
a) sent messages
b) Receive messages
c) Cancel messages
d) All of the above
20) Which function Erases any message currently in a notifier and returns the cancelled message.
a) Get notifier Status
b) Cancel Notification
c) Release Notifier
d) Send Notifier
21) ______ behave like single-element, bounded, lossy queues.
a) Notifiers
b) Queues
c) Semaphore
d) Rendezvous
22) If a notifier reference becomes invalid such as when another function closes it, the function stops waiting and returns error code___.
a) 1100
b) 1122
c) 1133
d) 1144
23) If the notifier does not contain a message, this function waits until the notifier receives a message.
a) Wait on notification
b) Obtain notifier
c) Release notifier
d) Cancel notifier
24) Which function sends a message to all functions waiting on a notifier.
a) Wait on notification
b) Obtain notifier
c) Release notifier
d) Send notification
25) Notifers are equivalent to
a) Single element FIFO
b) Multiple element FIFO
c) Multiple element LIFO
d) None of the above
26) Queues are equivalent to
a) FIFO’s
b) LIFO’s
c) FILO’s
d) LILO’s
27) Which function is similar to a Queue, but can only communicate one piece of data at a time.
a) Notifiers
b) Semaphore
c) Rendezvous
d) None of the above
28) If the Queue size is __, the Queue length is unlimited (as long as the memory allows).
a) -1
b) 0
c) 1
d) None of the above
29) To Queue data_________, no name is required, but is recommended.
a) Different Vis
b) within the same VI
c) Same Loop
d) None of the above
30) A Notifier has to be _________, before it can be used.
a) Obtained
b) Released
c) Send
d) Wait
31) Always a ______is used to access the Queues & Notifier functions.
a) Wire
b) Reference
c) Node
d) None of the above
32) Generate Occurrence function on a block diagram represents a single, unique occurrence.
a) True
b) False
33) The Generate Occurrence function is similar to a _____
a) Control
b) Indicator
c) Constant
d) None of the above
34) When a VI is running, every time a Generate Occurrence function executes, the function produces the _______
a) Different value
b) Same value
c) Missing value
d) None of the above
35) If you place a Generate Occurrence function inside of a loop, the value produced by the __________function is the same for every iteration of the loop.
a) Generate Occurrence
b) Wait for Occurrence
c) Set Occurrence
d) None of the above
36) If you place a Generate Occurrence function on the block diagram of a reentrant VI, the Generate Occurrence function produces a ______for each caller.
a) Same value
b) Different value
c) Missing value
d) None of the above
37) Which function Waits for the Set Occurrence function to set the given occurrence?
a) Wait on Occurrence Function
b) Set occurrence
c) Generate Occurrence
d) None of the above
38) Sets the specified occurrence. All nodes that are waiting for this occurrence stop waiting.
a) Wait on Occurrence Function
b) Set occurrence
c) Generate Occurrence
d) None of the above
39) Use these functions when you want one VI or part of a block diagram to wait until another VI or part of a block diagram finishes a task without forcing LabVIEW to poll.
a) Occurrence Functions
b) Boolean Functions
c) String Functions
d) None of the above
40) Which function returns TRUE only the first time you call it after you click the Run button.
a) First Call
b) And
c) Or
d) Select
41) You can place the First Call? function in multiple locations within a VI
a) Yes
b) No
42) You can place the First Call? function in multiple locations.
a) Within a VI
b) Multiple VI
c) Any VI
d) All of the above
43) First Call? does not return ______ a second time.
a) TRUE
b) FALSE
44) Which of the following does not conform to the Dataflow programming paradigm?
a) Shift Registers
b) Tunnels
c) SubVIs
d) Local variables
45) You need to programmatically update the value in a numeric control. Which is the most appropriate strategy?
a) Use a Functional Global Variable
b) Use a Local variable
c) Set the desired value as the default value
d) Use a Data Value Reference
46) When using functional global variables, Enums are the best way to determine which action to execute.
a) YES
b) No
47) Functional global variables use which of the following to store their data?
a) For Loop
b) Shift Register
c) Sequence Structure
d) Case Structure
48) Every instance of a functional global variable will call the same subVI.
a) YES
b) NO
49) Which of the following is not used in functional global variables?
a) While Loop
b) Case Structure
c) Shift Register
d) File I/O
50) In which case can functional global variables be used?
a) Reading Values
b) Writing Values
c) Performing Calculations
d) All of the above
51) Functional global variables are VIs that use loops with ________shift registers to hold global data.
a) uninitialized
b) Initialized
c) Zeroed
d) All of the above
52) Every time when you call the functional global vi, the block diagram in the loop runs exactly.
a) 2 time
b) 1 time
c) 0 time
d) Infinite time
53) One of the advantages of using Functional global variables.
a) Avoid the race conditions
b) Increase the storage capacity
c) Shift the values
d) We can use within the project.
54) Functional Global Variables are a good way.
a) To save data
b) To remove data
c) To protect critical sections.
d) All of the above
55) If there is NO wire feeding a shift register , then the Shift register is _____
a) Initialized
b) broken
c) Not initialized.
d) Local
56) A Functional Global variable is a sub vi that must not be set to be _______
a) Entrant
b) Cluster
c) Re-entrant
d) Array
57) Functional Global Variable can be used to call Multiple locations
a) Yes
b) No
58) Functional Global Variables can be used as shared variables.
a) No
b) Yes
59) Local and Global variables are, technically speaking, _______
a) LabVIEW structures
b) LabVIEW loops
c) LabVIEW Nodes
d) LabVIEW Clusters
60) Which provide a way to access front panel objects from several places in the block diagram of a VI.
a) Constants
b) Local variables
c) Property Nodes
d) Indicators
61) Local variable function is available in the _______ palette.
a) Structures
b) Strings
c) Application Control
d) Synchronization
62) Virtually any control can be used as an indicator, or any indicator as a control.
a) No
b) Yes
63) Local variables have two modes.
a) Read and log
b) Write and log
c) Read and Write
d) True and False
64) In the Read mode the local variable acts like a
a) Indicator
b) Control
c) Cluster
d) Array
65) In the Read mode the local variable acts like a
a) Indicator
b) Control
c) Cluster
d) Array
66) A race condition occurs if two or more copies of a ___________in write mode can be written to at the same time.
a) local variable
b) Global variable
c) Controls
d) Indicators
67) Variables pass the data from one place to another without_____.
a) Wires
b) Nodes
c) Controls
d) Indicators.
68) Store data in while loop shift registers.
a) Local variables
b) Global Variables
c) Functional Global variables
d) Clusters
69) A local variable is a
a) Front panel object
b) Block diagram object
c) Connector pane object
d) All of the above
70) To create the local variable, right click on the control and select____
a) Create- >Local variable
b) Data operation -> Local Variable
c) Local Variable
d) View as local variable
71) If you change the Control label , the local variable label also changed automatically.
a) No
b) Yes
72) To change the local variable to Control, right click on object and select___
a) Change to write
b) Change to read
c) Change t o Control
d) Change to indicator
73) To change the local variable to Indicator ,right click on object and select ___
a) Change to write
b) Change to read
c) Change to Control
d) Change to Indicator
74) Shared variables share the data between ____vis.
a) Same VIs
b) Multiple Vis
c) Common Vis
d) All of the above
75) To share the data between multiple vis.
a) Local Variables
b) Global variables
c) Clusters
d) Arrays
76) Which variable is commonly used to eliminate race conditions by preventing simultaneous access to code or data?
a) Functional global variable
b) Local variable
c) Global variable
d) Shared variable
77) Which is not an important part of creating a Functional Global Variable?
a) Using Shift Registers to store information
b) Changing the VI’s execution settings to Reentrant
c) Setting the VI to inline into calling VIs
d) Setting the While Loop to stop after one iteration
78) Which of the following illustrates an advantage of a global variable over a local variable?
a) A global variable can pass data between two independent VIs running simultaneously
b) Only the global variable can pass array data, local variables cannot
c) Global variables follow the dataflow model, and therefore cannot cause race conditions
d) Global variables do not require owned labels to operate
79) Which of the following must be used with in a project?
a) Local variable
b) Global Variable
c) Functional Global Variable
d) Single process shared variable
80) Which of the following cannot be used to pass data between multiple Vis?
a) Local variable
b) Global Variable
c) Functional global variable
d) None of the above
81) Which a method is of eliminates race conditions?
a) Providing only one write to a shared resource
b) Reducing use of variables
c) Providing only one reader to a shared resource.
d) None of the above
82) Which method enables you to synicronize consumer loops to the producer loop while retaining current and past data for transfer?
a) Variable
b) Queues
c) Notifies
d) None of the above
83) An alternative to use the functional global variables to protect critical section of code
a) Global Variables
b) Local Variables
c) Semaphores
d) Notifies
84) Semaphores are specifically designed for
a) To protecting Resource& Critical Section of Code
b) Adding the Data to database
c) Filtering unused Resources
d) None of the above
85) The notifiers don’t not buffer data.
a) No
b) Yes
86) Which of the below is working on polling the front panel?
a) Notifies
b) Queues
c) Event driven
d) State Mechine
No comments:
Post a Comment