1 / 23

Workshop 5 of 7

Welcome!. Workshop 5 of 7. Today's Topics. Review of Workshop 4 File Input/ Ouput Binary files TDMS files Polymorphic VIs. Review Question 1. Which of the following are reasons for using a multiple loop design pattern ? Execute multiple tasks concurrently

opal
Télécharger la présentation

Workshop 5 of 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome! Workshop 5 of 7

  2. Today's Topics • Review of Workshop 4 • File Input/Ouput • Binary files • TDMS files • Polymorphic VIs

  3. Review Question 1 • Which of the following are reasons for using a multiple loop design pattern? • Execute multiple tasks concurrently • Execute different states in a state machine • Execute tasks at different rates • Execute start up code, main loop, and shutdown code

  4. Review Question 1 • Which of the following are reasons for using a multiple loop design pattern? • Execute multiple tasks concurrently • Execute different states in a state machine • Execute tasks at different rates • Execute start up code, main loop, and shutdown code

  5. Review Question 2 • The major difference between Notifiers and Queues is: • Notifiers cannot send data with the notification, but queues can. • Notifierscannot buffer data that is sent, but queues buffer data. • Notifierswill make the slave loop wait on the notification, a queue does not make the slave loop wait.

  6. Review Question 2 • The major difference between Notifiers and Queues is: • Notifiers cannot send data with the notification, but queues can. • Notifierscannot buffer data that is sent, but queues buffer data. • Notifierswill make the slave loop wait on the notification, a queue does not make the slave loop wait.

  7. Review Question 3 • Which of the following are valid data types for queues and notifiers? • String • Numeric • Enum • Array of Booleans • Cluster of a String and a Numeric

  8. Review Question 3 • Which of the following are valid data types for queues and notifiers? • String • Numeric • Enum • Array of Booleans • Cluster of a String and a Numeric

  9. File Input/Output • At their lowest level, all files written to your computer’s hard drive are a series of bits

  10. File Formats

  11. File Input/Output Architecture • File I/O writes to or reads from a file • A typical file I/O operation involves the following process: Open/Create/Replace File Read and/orWrite to File Close File Check for Errors

  12. File I/O: Writing (Binary) • Strings • series of unsigned 8-bit integers, each of which has a value in the ASCII Character Code Equivalents Table • Arrays • represented as a sequential list of the elements (representation dependent on data type of element) • a header contains a 32-bit integer representing the size of each dimension • Boolean • LabVIEW represents Boolean values as 8-bit values in a binary file • Eight zeroes represents False • [00000000] • Any other value represents True • [00000001], [01000110], [11111111], etc • Integers • Binary ValueU8 Value • 00000000 0 • 00000001 1 • 00000010 2 • 11111111 255

  13. File I/O: Reading (Binary) • Two methods of accessing data: • Sequential Access—Read each item in order, starting at the beginning of a file • Random Access—Access data at an arbitrary point within the file Random Sequential

  14. File I/O: TDMS (Technical Data Management Streaming) • TDMS file • Binary file (.tdms) that contains data and stores properties about the data • TDMS_Index file • Binary index file (*.tdms_index) that provides consolidated information on all the attributes and pointers in the TDMS file • Speeds up access to the data while reading • Automatically regenerated if lost • TDMS file format internal structure is publicly documented

  15. File I/O: TDMS • Channel • Stores measurement signals or raw data in a TDMS file • Each channel can have properties describing the data • The data stored in the signal is stored as binary data on disk to conserve disk space and improve efficiency • Channel Group • Segment of a TDMS file that contains properties and one or more channels • Use channel groups to organize your data and to store information that applies to multiple channels

  16. File I/O: TDMS • Properties • You can assign properties to • entire file • Channel Groups • individual Channels • Examples: • File: Date/Time of logging, user signed into system • Channel Groups: Location of sensor group (top of the bridge), types of sensors (strain, temperature, etc.) • Channel: Sensor ID, max/min readings

  17. File I/O: TDMS Functions • Use the Express VIs : • quick, but little control of organization • --- Write to Measurement File • --- Read from Measurement File • Use the TDM Streaming API • Total control over organization, more involved set-up • Use the TDM Excel Add-In Tool • Allows you to read TDMS files in Microsoft Excel

  18. File I/O: TDMS • Data subset to read/write is determined by group name and channel name(s) inputs

  19. File I/O: TDMS • Setting/getting the properties of the TDMS file, channel group, or channel is dependent on if the group or channel name is specified

  20. File I/O: TDMS File Viewer • Opens TDMS file and presents the file data in the TDMS File Viewer dialog box

  21. Demonstration: TDMS Viewer in Action

  22. Polymorphism • Definition: a programming language feature that allows values of different data types to be handled using a uniform interface. • In LabVIEW: the ability of VIs and functions to automatically adapt to accept input data of different data types • i.e. Numeric Functions • Useful when performing the same operation on different data types

  23. Creating Polymorphic VIs • Create and save VIs that will be instances of the polymorphic VI • - Note: VIs must have the same connector panes • File » New…» Polymorphic VI • Add VIs to list of Instance VIs • 3b. Select other options; edit Icon • File » Save • - Your polymorphic is saved and available for use in block diagrams

More Related