Home

A Web-Configurable LabVIEW Virtual Instrument for a BL2600 and

image

Contents

1. an unsigned integer of the right size then to a boolean array which is fed to a cluster of panel indicators Note that a numeric constant is used to define the type and size of the output of the Type Cast function The value of the constant is meaningless the constant s data type and size are set in the properties dialog of the constant For analog values For loop structures are used to extract one 4 byte floating point value at a time from the data packet and insert it into an array of floating point values which are fed to a of cluster of VI panel indica tors AN408 www rabbit com 9 More on the BL2600 Program The high level operation for the BL2600 application is described in the following pseudocode The struc ture of the actual code differs somewhat because the LabVIEW Communication task is implemented with a Dynamic C costatement The If statements shown at the top of the task are actually waitfor statements in the code See the Dynamic C manual for a discussion of multitasking with costatements BEGIN IF FIRST RUN WRITE ALL PROGRAM PARAMETERS TO FLASH READ ALL PROGRAM PARAMETERS FROM FLASH INITIALIZE BOARD AND I O IF RN1100 PRESENT INITIALIZE RN1100 SET BL2600 amp RN1100 OUTPUTS AND SHADOW DATA TO INIT VALUES READ BL2600 amp RN1100 INPUTS INITIALIZE ETHERNET AND TCP IP STACK INITIALIZE HTTP SERVER DEFINE USER AND ADMIN HTTP ACCESSES WHILE 1 LABVIEW COMMUNICATION TASK IF ETHERNET NOT READY EXIT TASK
2. IF VI CLIENT HASN T OPENED SOCKET EXIT TASK INITIALIZE LABVIEW VI SOCKET SET VI SOCKET TO ASCII MODE READ USERID amp PASSWORD FROM VI SOCKET VERIFY USERID amp PASSWORD IF ACCESS GRANTED WHILE VI SOCKET ACTIVE READ VI PANEL DATA FROM SOCKET PARSE RECEIVED DATA AND SET OUTPUT SHADOW DATA FORM DATA FOR VI FROM LAST INPUT VALUES AND SHADOW OUTPUT DATA WRITE DATA TO SOCKET YIELD TIME TO BACKGROUND PROCESSING ZEND IF END OF LABVIEW TASK BACKGROUND PROCESSING READ BL2600 AND RN1100 DATA IF ALARM CONDITION SEND ALARM EMAIL S HTTP SERVER TICK CALL IF MESSAGE RECEIVED FROM BROWSER INTERFACE HANDLE CONFIGURATION CHANGES WRITE TO BL2600 AND RN1100 OUTPUTS FROM SHADOW DATA END WHILE AN408 www rabbit com 10 E Mail Alarms From the page shown in Figure 2 click on the link titled Configure E Mail Alarms to go to the page shown in Figure 8 As you can see it is easy to configure an e mail alarm for any of the I O channels The BL2600 will send an e mail to all of the addresses listed whenever an alarm condition is true To repeat edly send e mails while the alarm condition remains true type a value other than 0 in the textbox labeled Interval The unit of measure is 15 minutes so a value of 4 causes an e mail to be sent every 60 minutes Address fa http 69 104 38 49 8148 admin almefg zhtml gt Go Figure 8 BL2600 Alarm Configuration Set Di
3. II mode must still be used to send data to the BL2600 because Lab VIEW Express has no TCP IP socket write binary mode We also make use of LabVIEW s clusters of indicators and controls to avoid wiring each channel individually in the block diagram As with the AN407 VI the default case is a non ACK ed password or TCP IP error which causes a dialog error message to display on the VI and the While loop to exit An iteration variable is created automati cally at the lower left when a While loop is created and here we hook the variable to a VI display indicator to show the number of iterations The next nested structure is a Case structure with a true and a false case the LabVIEW equivalent of an if else construct The case for no TCP IP error and an ACK ed password output of the string match func tion equals 5 contains a nested flat sequence structure The first frame in the sequence shown in Figure 6 reads the VI inputs and forms them into a string First the digital input toggle switch clusters are converted AN408 www rabbit com 7 to boolean arrays to integers and finally to two text strings which are concatenated to form the initial string input for the Format into string function The format string function with the 6 3f 6 3f 6 3f 6 3f format specifier will look familiar to C programmers It is used to format the analog output control floating point values Finally the RN1100 digital output toggle switc
4. Semiconductor AN408 A Web Configurable LabVIEW Virtual Instrument fora BL2600 and RN1100 This application note AN408 expands on Application Note 407 AN407 to describe a more advanced BL2600 application to interface with a PC based LabVIEW Virtual Instrument VI It is recommended that readers examine the AN407 application before considering this one All application notes are avail able on the Rabbit website The application described in AN408 adds the following improvements over the application described in AN407 e Configuration with a web browser e Use of a RabbitNet RN1100 digital expansion board e Web page display of BL2600 and RN1100 I O data e E mail alarms for any BL2600 or RN1100 inputs e Flash storage of configuration parameters e Multiple user IDs and passwords can be defined e Allows different levels of access to several users e Passwords are not transmitted in clear text Storage of last entered IP address and user ID in Windows registry e More efficient data transmission b our rapid application development system for The configuration pages are created using RabbitWe creating web pages that interface with embedded applications This application is not designed to handle multiple VI users simultaneously but the web server can serve pages to multiple users concurrent with VI interface usage Because multiple VIs are not implemented attempting to access the BL2600 from a sec ond VI while one i
5. a user to the list you can allow additional access to that user This has some security concerns which are discussed in the section titled Security Figure 9 Address ja http 69 104 38 49 8148 adminjaccess zhtml User Access and IP Settings Communication Settings Add Delete User or Change User Info IP Address User List To delete a user submit a blank form for that ho aho fe fias rAd usog A admin rights E You cannot delete the Administrator or SMTP Server Address Admin admini A remove administration rights from the fio fio fi E User 1 user01 Administrator User 2 BL2600 LabVIEW Port User 3 You cannot use users IDs for their e95 User 4 passwords User 5 Passwords and IDs must be between 6 and User 6 Submit Reset User 7 15 characters long User 8 New IP Address requires BL2600 User 9 reset to take effect Connection User 10 will be lost while BL2600 restarts User 11 Select User User 12 Administrator S Admin rights I Reset BL2600 User 13 User 14 User ID User 15 Password Confirm PW Powered By Back to o f y Sti main page Ss e User added successfully Flash Storage of Configuration Parameters As mentioned previously in the section titled Defining the Default Configurations configuration param eters are stored in the User block This is an area on the primary flash that is accessed with the API func tions fo
6. available from National Instruments or third parties LabVIEW Express 7 1 has nothing available for enhanced TCP IP security short of implementing security protocols by hand If high security is important disallow users with admin rights use of the VI interface so that admin pass words are not habitually sent with weak encoding from the VI The following commented out line is included in the source code to disallow users with admin rights from using the VI Use this if test instead to prevent administrator from using the LabVIEW VI if stremp userid inbuffer amp amp users i group admin Allowing only viewing of data in the VI so that dedicated hackers could not change outputs on the BL2600 remotely is another possible security measure Distributed VIs can have the block diagram password protected for no write access without a correct pass word no read or write access without a password or no password protection at all This is done on the LabVIEW file menu More Information e Rabbit Semiconductor www rabbit com e National Instruments www ni com AN408 www rabbit com 13
7. g this same method AN408 www rabbit com 6 The password encoding is done in Frame 4 The relevant portion of Frame 4 is shown in Figure 5 Each byte is XOR ed with its index position added to an arbitrary number Not completely arbitrary a value is chosen such that the high bit will always be set for encrypted alpha numeric characters thus preventing a string terminating zero from appearing prematurely in the encrypted string since the password user ID is sent in ASCH mode The rectangle with x 165 is a LabVIEW Expression node The input is the For loop variable i which is created automatically when a For loop structure is created so the output is i 165 for each loop iteration Figure 5 Encryption algorithm in the VI Frame 4 Replace Array Subset E Hi aR The properties of the XOR operation allow the exact same method to decode the encoded text on the BL2600 side to check the password which is appended to the front of the array userid Quick amp dirty decoding for j 0 j lt strlen users i pw j userid j 165 j userid j Main Processing Loop Frame 7 is the main processing frame The frame s processing is a While loop that executes as long as the Stop button is not hit and the boolean variable STOPALL is false It is set to true when a TCP or other error occurs The overall operation is like Frame 6 in the AN407 VI but here we process data in binary format sent from the BL2600 ASC
8. gital Inputs to If 1 to generate e mail alarm if an input is 1 Set to If 0 generate alarm when input is 0 For analog inputs If in range means send alarms if the input is between Min and Max If out means send alarms if input is outside that range Alarms will be sent to each defined e mail address at the interval specified in 15 minute units if the input condition still exists An interval of 0 means send only once E mail Addresses Interval fa falarmrecipient domain com Save Email Information Reset Address Form Powered By eee Configurable Digital 1 0 Ch Off If1 If0 o oO nn bone 2 HHHH ONBO 3333In n a E e e a E O A a a O E A a A A F e e eeerkreeeeenveeee 15 Analog Input Ch Off Ifin range If out o e K a a 1 C 2 e s 3 K C o Min Max fo ooont fo oo000 0 0000C 410 00001 o o000 fo o000 Digital Input Ch Off IEK 0 o e 2 Cc 1 e Cc Cc 2 amp s Cc 3 C e 2 4 amp e Cc a Qg s Cc 6 2 K 7 C Cc Cc 8 C Cc e 9g C e 2 10 e 11 C K 12 a 13 Cc Cc 14 e Cc is e 2 Save Config Reset Form AN408 www rabbit com 11 Multiple Users and Their Access From the page shown in Figure 2 click on the link titled Configure Access to go to the page shown in Figure 9 This configuration page allows you to make runtime changes to the IP addresses as well as the list of users By checking the Admin rights box when adding
9. he string stored at location 0 in the User block This method is often called super initialization All of the following may be changed at compile time or at run time via the web browser e BL2600 analog and digital I O configuration e RN1100 analog and digital I O configuration e IP address LabVIEW port e User account IDs passwords and administration rights e E mail alarms settings for inputs e mail alarm recipient addresses and the e mail alarm interval Read the code comments in the program to learn more about changing default configuration information at compile time Using the RN1100 To add an RN1100 unit connect the RN1100 power and communication cable as described in the RN1100 manual go to the Configure RN1100 web page and hit the Add button The application currently han dles only one RN1100 but most of the program is structured to allow for two Only some of the target communication needs to be modified to handle the second unit Modifying the VI and C program to handle a second unit is left as an exercise for the user The application currently sends and receives dummy data for one RN1100 even if no RN1100 is connected The design decision that needs to be made to handle a second unit is whether to send dummy data for it change the VI to handle a change in the size of the data stream while running or to disallow adding removing RN1100 units while the VI is running The first and last choices will be the easier o
10. hes are converted to an ASCII integer and appended to the output string Again the use of clusters here makes for a much simpler diagram than if each element had to be wired one at a time Figure 6 Forming the output data string Boolean Array To 6 3F 6 3F 6 3F 6 3f LES To Decimal String Format Into String Concatenate Strings DIOSW 7 Pwa a 229 Concat 2 Strings a ina EE JBL into initial string H7 pa ai Cluster To A H Hh ere r asiz E EOL Constant RNDOSW E To Decimal String ai p Tm 6 i 333 x be sets Toa Boolean Array To To Decimal String bc i ZE LE Sl Cluster To Arra The second frame in the nested flat sequence sends the output string to the BL2600 with a TCP IP socket write and the third frame receives a data packet from the BL2600 The third frame in the nested flat sequence receives a binary data string containing both input data and shadow output data from the BL2600 and RN1100 Figure 7 shows a part of the conversion from binary data to VI panel output in the fourth frame AN408 www rabbit com 8 Figure 7 Converting binary data to VI panel output xtract I O data from re ots of conversion is ret yte order must be reve umbers Indicators are The conversion for digital values requires extracting the correct number of bytes from the correct offset in the data packet reversing the byte order if it is a multi byte value converting to
11. igure 2 Front page for configuration via browser Address http 10 10 6 148 BL2600 RNi100 Internet Data Acquisition Configuration Configure BL2600 Configure E mail Alarms Configure RN1100 Configure Access Display I O Powered By ABET eee ex Rabbit Semiconductor Z World Done internet AN408 www rabbit com 3 To change the default IP address at compile time the following macros near the top of the program should be changed These override the IP address setting in TCP_CONFIG LIB and are defined in separate macros and variables as a convenience for working with them as RabbitWeb variables define IPADDRO 10 define IPADDR1 10 define IPADDR2 6 define IPADDR3 148 A number of other default configurations can be changed at compile time There are too many too list here and they can all be changed at run time via the more intuitive browser interfaces If any default setting is to be changed at compile time it is important change at least one character in this macro definition define DAK INI FLAG 00 BL2600 DAAK Z World Rabbit Semiconductor 2004 Default configurations are stored in flash memory on program startup whenever the exact string above is not found in the first position in the User block space in flash The first time the program is run the config uration parameters including DAK_INI_ FLAG are written to flash Thereafter they are written only if DAK _INI_FLAG is different from t
12. nes to implement Compile and Run BL2600_VI_02 C Compile the program and run it as you normally would See the Getting Started section of the BL2600 User s Manual if you have not done this yet AN408 www rabbit com 4 The VI The Zip file accompanying this document contains the LabVIEW file BL2600 VI_02 VI This file is the VI and is modifiable with LabVIEW The Zip file also contains an EXE version of the VI that runs stand alone after installing LabVIEW support and cannot be modified with LabVIEW The software needed to create EXE files from VI files is not part of the basic LabVIEW package and must be purchased separately from National Instruments You can run either version of the VI BL2600 VI_02 VIor BL2600 VI_02 EXE Running BL2600_VI_02 VI Double click on the file BL2600_VI_02 VI You must have LabVIEW version 7 1 or later installed to open this VI file Now click the Run Continuously button Figure 3 on the LabVIEW control bar Figure 3 When you start the VI it will loop waiting for you to click the Start button But before pressing the Start button you must enter a password and user ID The IP address and the user ID are stored in the Windows registry and will be filled in automatically but the password must be entered each time the program is stopped and restarted BL2600 is a default for both user ID and password programmed into the BL2600 Now press the Start button within the VI and once the passw
13. ord is accepted you can adjust the analog slide controls and flip toggle switches to control output while you view input Running BL2600_VI_02 EXE Before you can run the stand alone VI BL2600 VI_02 EXE you must already have LabVIEW or Lab VIEW support installed or you need to run the LabVIEW client installation in the install folder the installation program there is SETUP EXE Once you have run the installation you can run BL2600 VI_02 EXE by double clicking on it then click the Run Continuously button Figure 3 so that it appears black As described above when you start the VI it will loop waiting for you to press the Start button After you press the Start button and once the password is accepted you can adjust the analog slide controls and flip toggle switches to control output AN408 www rabbit com 5 How It Works This section describes details of both the LabVIEW VI and the program running on the BL2600 LabVIEW VI The LabVIEW program is laid out as a large flat sequence structure The operation is very similar to the AN407 VI so we will focus on the functional changes and additions here Within LabVIEW you can look at the block diagram for BL2600 VI_02 VI You can toggle between the block diagram and the front panel by using the keyboard shortcut Ctrl E The VI discussed here uses some trickier LabVIEW techniques to convert binary data to panel indicator data It uses clusters of indicators and control
14. ramming the same BL2600 program used here could also interface with PC front ends created with such tools as Visual Basic Delphi or Windows C development packages AN408 www rabbit com 2 Running the Sample Application You can loop back I Os on the SBC to see the VI in action as with AN407 or connect to external input or measurement devices Read the BL2600 User s Manual before using the board s I Os The BL2600 The sample program to run the SBC is BL2600_ VI_02 C The program can be found in AN408 zip and AN408b zip two ZIP files that accompany this document AN408 zip contains application files and the installation for LabVIEW support AN408b zip contains only the application files Connecting to the Network You must have a free fixed IP address on your local network to run this application Connect the BL2600 Ethernet port to a hub or switch or connect it directly to your computer s Ethernet port using a cross over cable The PC s IP address must be set to a fixed address different from the IP address for the BL2600 Defining the Default Configurations If you change nothing in the program BL2600 VI_02 C you will be able to run the program and con figure the BL2600 program using the RabbitWeb interface i e the HTTP server provided in BL2600 VI_02 C ina web browser using the factory default address of http 10 10 6 148 The HTTP server and VI communications use the same IP address but different ports F
15. s already running will cause a timeout or other TCP IP error in the VI 022 102 Rev B www rabbit com 1 Figure 1 LabVIEW BL2600 Virtual Instrument 10 20 6 248 4 4 4 4 4 J 4 4 4 4 4 4 A 4 ee N ha a a a a In both the AN407 VI and the AN408 VI you can use switches and other controls to tell the BL2600 to set specific analog or digital outputs The AN408 VI adds output indicators and more I O by using the RN1100 expansion board The AN408 VI reads the outputs from the BL2600 as well as from the RN1100 to set the state of the corresponding indicators The VI receives the outputs from shadow data allowing for independent setting of output data by the remote units if some autonomous control heuristics are added to the BL2600 program The BL2600 program is complete enough that some developers will be able to use it without modification creating an application entirely in the LabVIEW development environment if local autonomy on the BL2600 is not needed Others will want to modify the BL2600 program to have autonomy to control pro cesses or tests when no VI is being used or to augment human control when using the VI The versatility of Dynamic C and LabVIEW make it easy to create applications with different degrees of autonomy A BL2600 program that runs completely autonomously but allows real time viewing only of data in a VI is another possibility Because the connection is done with simple TCP IP socket prog
16. s so that each indicator and control does not have to be wired on the diagram individually as in the AN407 VI Initialization As with the AN407 VI the first five frames of the block diagram perform fairly self explanatory initializa tion and password verification The labeling facilities of LabVIEW were heavily used to describe what happens The new elements are e Windows registry storage of the panel entered user ID and IP address these values are automati cally put in the text entry boxes on the next run of the program e Some encoding is done on the password so it doesn t get sent in clear text Frame 2 shown in Figure 4 defines how the stored IP address is retrieved If there is an error reading the registry it is assumed that it has not been created yet and the entry is then created with default values writ ten to it Writing to the Windows registry is shown in the larger True block in Figure 4 the default IP address is 10 10 6 148 If this fails the default IP address is assigned to the appropriate variable shown in the small True block located within the larger one and execution continues Figure 4 Getting the IP address from the registry Frame 2 After the Start button has been clicked whatever was entered for the IP address on the VI panel is written to the Windows registry This is done in Frame 5 using the same method we just saw in the True block from Frame 2 Writing the user ID to the registry is also done usin
17. und in the library IDBLOCK LIB To examine the code that handles the configuration parameter look in BL2600 VI_02 C atthe function InitializeAl11 S AN408 www rabbit com 12 Security Configuration pages in the web interface are password protected Up to 16 users may be defined with user names and passwords that are used for both the web configuration and the VI front panel access Only users with administration rights may change configurations via the browser interface The default adminis trator username and password are both admin1 Two additional default username passwords are provided without administration rights BL2600 BL2600 and user01 user01 When you change user accesses at run time you will not be able to use the same word for username and password Other rules and instructions for changing user information and other parameters are shown in the configuration web pages Whenever security might be an issue it is advisable to change all the user passwords at compile time or at run time before deploying The password protection for the configuration web pages uses digest authentication It could be modified to use SSL with the purchase of the Dynamic C SSL module Transmission security for access to the BL2600 through the VI panel is achieved by a quick and dirty encoding of the password that would be no challenge to a serious hacker If more security is desired for TCP IP within LabVIEW developers will have to explore what is

Download Pdf Manuals

image

Related Search

Related Contents

_ PARAMETRE DU COMPTE _ ACCEUIL  Lexmark C760, C762 (5060-4xx) Laser Printer Service Manual  Solida 取扱説明書(1.09MB 日本語)  4000112810-02 francais.indd  exacqVision Web Service - Gargoyle Security Inc.  Appareils de laboratoire Laboratory equipment  Sony SLV-D500P User's Manual  LG Electronics LMV1683ST Use and Care Manual  BA II PLUS™ Calculator  M an u al d o O p erad o r  

Copyright © All rights reserved.
Failed to retrieve file