Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Jun 26, 2009


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Simple Messaging Reference Library (STM) Reference Example for LabWindows / CVI

0 ratings | 0.00 out of 5
Print

Overview

The attached zip file contains an implementation of STM in LabWIndows / CVI and examples of its use.

Downloads

Filename: stm_for_cvi.zip
Requirements: View

Requirements

This code requires the Simple Messaging Reference Library (STM).

The included LabVIEW examples require LabVIEW 8.6 or higher.

The C code was written in LabWindows / CVI 9.0.  Much of the code can be converted to other LabWindows / CVI versions with minimal effort.

Contents

The zip file contains the following:

CVI Folder

This folder contains the LabWindows / CVI STM implementation as well as an example of its use.  The following files are significant:

CVI\_STM_libraries Folder

STM_Comm.h and STM_Comm.c

These files implement the main STM communication.  This is directly used to connect to the server / client, disconnect from the server / client, and send / receive messages.  Additionally, the functions in these files allow you to receive notification of a successful connection, the loss of a connection, the receipt of meta data, the receipt of any data on the STM socket, the receipt of an STM message, a successfully transmitted message and/or a connection error.  

STM_Convert.h and STM_Convert.c

These files provide a number of functions which help you to encode and decode data into a format acceptable by LabVIEW.  This is called flattening and unflattening.  Note that not all possible data types are implemented. If you need a data type that isn't available, use the provided functions as a guide and the refer to Flattened Data for the data format.

CVI\Server and CVI\Client Folder

STM Server Example.h, STM Server Example.c, and STM Server Example.uir

These files implement an example of using the LabWindows / CVI STM libraries to run an STM server and accept connections from an STM client.

STM Client Example.h, STM Client Example.c, and STM for CVI client.uir

These files implement an example of using the LabWindows / CVI STM libraries to create an STM client that connects to an STM server.

LabVIEW Folder

This folder contains LabVIEW VIs that implement the same functionality as the CVI Client and Server examples.
This code requires the Simple Messaging Reference Library (STM) to open.  This example is a good test for the LabWindows / CVI implementation as it uses multiple data types and arrays in its STM messages.

Requirements


Filename: stm_for_cvi.zip

Software Requirements


Application Software: LabWindows/CVI Full Development System 9.0, LabVIEW Professional Development System 8.6
Language(s): LabVIEW, C

 
0 ratings | 0.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).