Tuesday, 8 July 2014

Append data to File - LabVIEW

Implement the code as show in the below image to append a data to the existing file. Visit the link provided for full details.

I have tried this code for one of my project. it worked.



http://digital.ni.com/public.nsf/allkb/F55FD21DFEF0C3C1862571F500023123

Monday, 3 March 2014

common problems that you face with NI PDA and Solution

LabVIEW PDA keyboard popup


 When we develop the PDA project we may want to popup the onscreen keyboard, If we select to input in the text field. the below diagram will show you how to do that.
inside the ifelse loop place PDA show hide keyboard panel and activate when KeyFocus property



image

How to Put Image On LabVIEW PDA Front Panel?

I found a solution for the above said problem in NI website. Please visit the following link

http://digital.ni.com/public.nsf/allkb/AE2CEAB41359AB3086256E78000A5987

PIC microcontroller programming using LabVIEW

A toolkit for programming the 32bit microchip PIC microcontroller. personally I have not used this toolkit. I posted it just to share it for my readers. Soon I will try it and I will post the review of this tool kit.

3Dmicro Toolkit v2.1

image2
The following three examples are installed by the version 2.1 of the 3Dmicro Toolkit in your Document directory:
  • Ethernet Communication Example
    This example:
    • Reads the state of 3 switch buttons of the PIC32 Ethernet Starter Kit and turn on/off the corresponding LEDs indicators
    • Sends via Ethernet the number of pressed switches
    • Receives a string and sends it back via Ethernet communication
    • Receives a floating point number and sends it back via Ethernet communication
  • USB Example
    This example:
    • Uses the button switches 1 and 3 to start and stop the sampling session of the button switch 2 (Pressed/Not Pressed)
    • For each session creates a text file with a name that is incremented with the number of sampling session
    • Saves every 250 ms the state of the button switch 2 to the text file
  • Interrupts Example
    This example:
    • Reads the state of the button switch 2 on the Starter Kit and use that to change the Duty Cycle value of the PWM2 (LED2)
    • Receives a string via Serial communication and send it back on the same serial channel
    • Changes the LED3 state (On/Off) depending on the serial string received
    • Sends a string via Serial communication if the Interrupt 0 occurs
http://www.3d-svs.com/index.php

Text & decorations disappears in frontpanel LabVIEW PDA module

is your Text and decorations disappears in front panel PDA mobile program that is developed using LabVIEW PDA module?

are you using tab panel in your PDA program and disabled the visibility? If yes. then you have to make it visible. Don’t hide it programmatically, in properties and don't hide out of the screen size. If any of this if you have done in your front panel design, then any text in the label or decorations that you have inserted for controls, indicators wont appear in the mobile PC

Front panel, that we design in desktop for mobile PC/ PDA using LabVIEW PDA module wont appear  same way in mobile PC. lots of problems will arise in alignment. text disappearing is one of that kind. See the correct usage of tab control for mobile PC.
image
image
image

Using MySQL with the Database Connectivity Toolkit on Windows

Solution:
There are several ways to connect to a MySQL database from LabVIEW using the Database Connectivity Toolkit. This article outlines how to use the ODBC tools provided by Mysql.com. This article also assumes that you either have a MySQL database installed and running on your current computer or another computer accessible through the network (see Remote Access from your webhost)

  1. Download the ODBC server MSI from mysql.com.
  2. Install the server on your PC
  3. Navigate to Start»Settings»Control Panel»Administrative Tools»Data Sources (ODBC)
  4. Click the Drivers tab and ensure that MySQL is listed
  5. Go back to the User DSN tab, click Add, and select MySQL

  6. A new window will popup allowing you to enter in your connection information to your MySQL server. The default port number is 3306. You can enter localhost as the server name if you have it installed on the computer you're currently working on.
  7. In LabVIEW, put a DB Tools Open Connection VI on the block diagram and wire a TRUE constant into the prompt input.
  8. Run the VI
  9. A prompt will come up titled Data Link Properties. On the Provider tab, leave the setting to the default, which is Microsoft OLE DB Provider for ODBC Drivers.
  10. Select the Connection tab, and from the Use data source name drop down list select the server connection you've just created.
At this point, your application will error out, but that's because you did not do anything with the connection. In your application, be sure to use a DB Tools Close Connection VI at the end of your program or database access. You can specify the path to your DSN file by creating a control wired to the source terminal on the DB Open Tools VI and setting the prompt value to false.
For further help, see the Database Connectivity User's Manual.
Related Links:
MySQL Connector ODBC
Product Manuals: LabVIEW Database Connectivity Toolkit Manuals (June 2008)
NI Developer Community: How to Make a Parameterized Query into a Stored Procedure Routine with MySQL Databases

Reading last row data from Mysql database using LabVIEW

image

I have used LabVIEW 2011, database connectivity toolkit to develop the database program. In LabVIEW database connectivity toolkit there is not straight vi to access the last record from the database.
to get the last record,
1. Add one extra column named ID with the parameter of int & auto increment.
2. Like I shown in the above diagram code your program. you will get the maximum value of your ColumnID.
3. then you can add another select.vi with where ID=column ID that you got from the previous select.vi
4. You will get the last record.

Wednesday, 5 February 2014

First Step in LabVIEW Websocket project

FIRST SAMPLE PROJECT

Plan for first sample project. 

  • Generate a random number, store in a array and publish the array over network.

Tools I need

  • Labview
  • SCCT 3.0
Before start this project, I checked the examples supplied by TSM4. So that I can make use of it as a template for mine.

Fortunately I found a example project similar to one I want to develop. publisher-subscriber-demo.lvproj. this example is exact match to my plan of sample example project with little extra vi's. So I am going to make my simple from this supplied example.

The publisher-subscriber-demo.lvproj project contained two files named publisher and subscriber. from the name it is clear that publisher vi will have the code for generating the data and publish it. Subscriber vi will have code for connect to the publisher and present the data received.

In a Publisher.Vi, Five stages of code was documented,

1. Create configuration for subscribers
2. start publisher
3. publish data
4. check active subscribers count
5. terminate publisher

now we got a template from this vi to prepare our publisher vi. 2nd,3rd & 5th vis are must have vis in any project it seems. we will use those vis remaining thing let us go in details right now.


  • First I saved this project in my project folder in the name of RandomData_Sample.lvproj
  • Opened the publisher.vi, deleted the 1st & 4th stage vis and saved vis after correcting all the wires.

Block Diagram of Publisher.vi


Front Panel of Publisher.vi


two column & hundred rows Random number array is generated and connected to PublishData.vi for publishing the data

In the front panel, port and API-key controls are the input to the StartPublish.vi. The details of the port & API-Key will be explained later in the project. So whatever used in the supplied example is used as it is without any change.

It was ran and stopped. There is no any error in the vi.

Now, let us look in to subscriber vi. There is no need of change in this vi. we can use it as it is. Before proceeding let us understand what is there in this vi.

Subscriber vi contains OpenConnection.vi, TransferStatus.vi, ReadAnalogData.vi & CloseConnection.vi all these vi's are important for any subscriber vi that we develop except there will be changes ReadAnalogData.vi based on the type of data that we get.


Block Diagram of Subscriber.vi


Front Panel of Subscriber.vi

Let us run the publisher & subscriber .vi and check the program. Program ran successfully. our first simple program is completed.

basic familiarity is obtained. now we can proceed for the next step.