Jump to content

siva

Members
  • Posts

    34
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by siva

  1. These VIs cannot function properly if put in parallel. PLease do the following to over come the proble,

    1) Build a Wrapper VI (Driver VI / a single Interface VI) using 3 VIs(Init, Update, Scan) as SubVIs

    2) Use the Wrapper VI in your code instead of directly calling Init, Update or Scan..

    This will overcome the race around condition..

    Please write to sivamgr@gmail.com if you face any problem in implementing this..

    QUOTE(jared @ Feb 29 2008, 05:35 AM)

    Thanks for all the help you have giving me previously... I am using your EtherNET/IP VIs but I had problems when trying to use the Update VI. I have several instances of the SCAN VI to read different integers, but as soon as I try to use a Scan VI to write a value to the PLC I get an error (something that has to do with the network busy or something like that). Any ideas of why this error and what do to to fix it. The weird thing is that when I use the Test program you provide (one SCAN and one Update) it works fine... but as soon as I put it in MY program with multiple Scans, then I get the error. Any ideas will be greatly appreciated.

    Jared

  2. QUOTE(jared @ Jan 11 2008, 05:00 AM)

    Hi, I tried the VIs using a control to replace the "Fileno" Constant(0x07), However I got errors for each N value I tried, except for N7... Any ideas where my problem is? Also, if I want to write o read a Bit, do I only need to change the FileType to 0x85?

    Thanks

    Hi Jared, By Changing the Constant(0x07),. any Integer file can be accessed. But, before changing the constant, create that particular file in the PLC and configure it as integer. also configure the number of registers in that file as required. Accessing Bool File directly is a bit tough. Instaed of accessing a Bool File., You can keep some registers in the N7 and access it. In plc side, keep a logic to read from the integer file register and update the bool file. Use one of the these values for this field. Do not use any othervalues; doing so may result in unpredictable results.

    Admin Note: Content removed because it was messing up the RSS feed. Please don't use nonprintable characters in posts. Next time use an image of the content.

    • Like 1
  3. QUOTE(jmcbee @ Dec 27 2007, 11:50 PM)

    I was using Logitech QuickCam Chat Camera for testing..

    I am trying to figure out whats wrong with the activeX Code (VB 6.0 Code)..

    In the activeX Code, I am suspecting this line..

    hWndC = CapCreateCaptureWindow("LiveAcquire", WS_CHILD + WS_VISIBLE, 0, 0, 352, 288, UserControl.hwnd, 0)

    0,0,352,288 has to modified as 0,0,<default image width supported by cam>,<default image height supported by cam>..

    you can try with 0,0,960 ,720

    after changing, Make the Webcam.ocx and update the system32 with the latest ocx file and try again with the labview code.

  4. QUOTE(jmcbee @ Dec 27 2007, 11:36 PM)

    Hello,

    I have updated the driver and tried running your WebcamDemo.vi again. Now the program is catching in the Flip and Pad for Picture Control.vi, which is a subvi to Read BMP File.vi. I looked inside the Flip and Pad for Picture Control.vi and there are two nested for loops where the program is spinning. The outer for loop wants to run for 100680448 iterations and the inner loop wants to run for 73351168 iterations. Does this sound reasonable? Should I just wait for those loops to execute instead of considering the subvi to be stuck? Thank you again for your help!

    Cheers!

    "Read BMP File.vi" is a library function that is available under, "Graphics Formats Pallete". Please check the size of the BMP File. Are you able to open the BMP file using MS-PAINT?.

    What is your webcam model ?

  5. QUOTE(jmcbee @ Dec 27 2007, 11:27 PM)

    Thank you for the quick reply. The activex is not storing the image in the bmp file. I am in the process of reinstalling the cameras drivers. Out of curiosity, what does the wat accomplish in the code? Thank you for the help!Thank you for the quick reply. The activex is not storing the image in the bmp file. I am in the process of reinstalling the cameras drivers. Out of curiosity, what does the wat accomplish in the code? Thank you for the help!

    please check the source code attached in the earlier replies (LiveAcquisition_ActiveX.zip). The ActiveX sends simple messages to the device source driver using WIA Interfaces.

  6. QUOTE(Yen @ Nov 4 2007, 12:24 AM)

    Sounds interesting, but unfortunately requires the internet toolkit. :(

    That example demostrates the implementation of web2.0 with labview. Offcourse the demo needs internet toolkit.

    But, With proper implementation of web2.0, internet toolkit can be avoided.

    1) Point all the xmlopen function to a application server

    2) Implement a tcp communicator(labview code) in application server

    On a tcp request, read the network-shared variables and convert it into a csv string and send it as a tcp response

    3) in the ajax script, parse the value and update the graphics on the page.

    This technique demands very less bandwidth compared to the traditional approaches..

  7. post-4279-1198776073.jpg?width=400



    1) Make sure that you have given a valid path.
    2) After clicking the Snap, manually check the specified path and verify whether the activex is writing the snapshot into the specified file.
    3) If the latest snapshot is available in the specified BMP file then, Increase the delay specified in the code(WebcamDemo.vi) and test again.

    post-4279-1198776320.jpg?width=400


    4) If the latest snapshot is not available, then please reinstall the cam's driver and try again.


    QUOTE(jmcbee @ Dec 27 2007, 10:39 PM)
    Hello,

    I am using your WebcamDemo.vi and have followed your instructions for installation. When I open the program the LiveWindow displays the feed from my webcam however after taking a snapshot the Picture field is blank. I have followed the demo through as it executes and there are no errors, but for some reason the snapshot from the LiveWindow does not translate into a Picture. Do you have any ideas on what the problem may be?

    Cheers!
  8. QUOTE(longzoo @ Dec 4 2007, 11:53 PM)

    Hi Siva,

    I am attempting to use your EtherNet_IP_PCCC.zip files to communicate with a MicroLogix 1500. My problem is with writing to the PLC. I made a small test vi that uses your init, update registers, scan registers, and terminate vis. If i write a value, say 1F3A, to offset 0 all is well. I can read the 1F3A in the register array with no errors. But if i try to write to any other offset, say 2 or 4, i get a data error on the update register vi and when i try to read that offset i get a value that looks like a timer that is continually scanning. I guess i dont understand the registers :(

    Where did you get the information to set up the clusters for your vis? This is probably what would point me in the right direction.

    Thanks so much for the vis! i can tell that you have spent alot of time/work creating them. Once i get an understanding of the registry on the 1500 i feel sure communications will be a breeze :)

    I'm afraid that the Number of Registers in N7 File of your PLC is configured as 1. Configure the N7 File Size accordingly before using the VIs.(You can set the no of registers in N7 as 256).

    Hope this would solve the problem. If not, Please send a Snapshot of the test VIs.

  9. The Present set of VIs does not fully support reading/writing of the following types of tages

    1) Timer Tags

    2) Control Tags

    3) Counter Tags

    4) Data Structures

    However ACC, PRE elements of timer\control\counter tag-structures can be accessed.

    To access ACC element of a Timer, say timer-1, use "timer1.ACC" as Tag-name and Datatype as DINT. Similiarly, to access Preset Element, use "timer1.PRE" as tag-name and DINT as datatype. By using this method, ACC, PRE of Timer, Control and Counter tags can be accessed.

    Note: "ACC", "PRE" should be in Upper Case.

  10. QUOTE(beckerg @ Nov 5 2007, 05:10 PM)

    I've analysed the sub vi for this issue.

    The Number of elements in the frame will always be an even number. Hence, Int(SizeOf(@array)/2) gives the same result as Quotient(Number=SizeOf(@array), Divisor=2). At no case, the frame will get composed of odd number of elements. Thats why the component is running with no-errors.

    anyway, its good to use quo-rem operator for this purpose. thanks for the suggestion

  11. QUOTE(sprezzaturon @ Nov 6 2007, 02:11 AM)

    Hello Siva,

    I tried using your latest OCX (after copying it to my system32 directory and regsvr32'ing it) but your example VI no longer works. Labview complains that there are no methods available and that the refnum class is not fully defined.

    Check the following.

    1) Open the VI. In the Front panel, Right Click on LiveWindow ActiveX Container

    2) Click, "Insert ActiveX Control". Select "WebCam.LiveWindow"

    3) Now Save and run the program.

    If you dont get "Webcam.LiveWindow" in the ActiveX Control List, it means that the activeX control is not registered properly. please do the registration steps again to fix it.

    Check the following.

    Note: For XP, Camera should support WIA or it should support TWAIN. If it TWAIN based, then check whether you have installed the Mini WIA Driver on top of the TWAIN Driver.

    For Win 98,2000 Please install the Windows TWAIN Drivers.

  12. QUOTE(beckerg @ Nov 5 2007, 05:10 PM)

    Hi beckerg,

    Thanks for your suggestions. Your suggestions are included into the code along with some other changes. I am waiting for the testing to happen. Once tested, the updated code will be uploaded into the LAVA code repository.

  13. <p style="text-align: left;"><a class="noborder" href="http://lavag.org/old_files/monthly_11_2007/post-4279-1194047889.jpg" target="_blank">post-4279-1194047889.jpg?width=400</a></p>

    A sample code to show the possibilities of LabVIEW +AJAX.

    To run,

    Download File:post-4279-1194047596.zip

    Unzip and copy the ajax_text.htm, diagram.js files to the following folder, <LabVIEW 8.x.x>\www\

    Download File:post-4279-1194047580.vi

    Copy the mycgi.vi to the following folder, <LabVIEW 8.x.x>\www\cgi-bin\

    now, start the G-Webserver ane surf the following link, <a href="http://localhost/ajax_test.htm" target="_blank">http://localhost/ajax_test.htm</a>

    This approach takes less band-width for transfering the information across the web. so, Controlling/monitoring the application through the web at low-bandwidth is possible.. No image tranfers. No need to install LV runtime at client side.

    All the presentation part is done using client-side javascripts. LabVIEW just passes the result data through the CGI.

  14. QUOTE(siva @ Oct 23 2007, 10:12 AM)

    You can speed up the database write by using bulk insert statements. This can be done in 2 ways.

    Method 1:

    =======

    1) Keep 2 loops. One loop for datalogging into a text file. Log all your values in a comma/delimiter seperated format

    2) In the other loop, Bulk insert the CSV file into the database using Bulk insert from file command. This loop can run at a very slow rate.

    Method 2:

    =======

    1) Keep 2 Loops. one loop for your control/dataacquistion. In that loop, enqueue the required data into a queue.

    2) In the Other Loop, Dequeue all the elements in the queue and form a Insert Statement like below.

    insert into myTable values (1,'Y',36.00),(2,'N',57.00),(row3),(row4),....(row n)

    and execute this statement. This loop can run at a very slow rate.

    Note: Method 2 is supported by MySQL but not supported by SQL Express.

    In my system, 500 individual Insert Statement take 33 Second to execute but, A single Insert statement with 500 rows takes less than 300 milliSec to execute.

    if the table contains key constarints and the data grows at a faster rate then it is better to run the database software in another machine. By this way the database application can use the resource efficiently without affecting the control/dataacquisition process for checking the constarints while row insertion. However the stability depends upon the network traffic for this approach.

  15. QUOTE(tmot @ Oct 23 2007, 12:57 AM)

    Hi!

    I have built a VI to aquire and save measurement data to a MySQL database. The data contains of 60 "ints and floats" and they are saved using the DB Tool Insert Data.VI. There is no problem with the functionality....except for the speed. When I enable the saving to database my software loop time increase from 8ms to ~50ms. When I turn off the saving the loop time decrease to 8ms again. The CPU power meter never goes above 15% of maximal use. The MySQL and LabVIEW-program runs on the same computer. I have LabVIEW 8.2.1 and Database Connectivity Toolbox.

    So, I have a couple of questions.

    1. Do you think I have over estimated the possibility of using LabVIEW and MySQL for this type of application? (60 ints/float @ 100 Hz)

    2. Do you have any tip for increasing the performance of my SQL Insert statement?

    I will run the control system for several hours so it will be quite a lot of data in the end. Thats why I would like to use a database. The database will also give me other great advantages compared to writing to a "text-file", ie search and extract data from other computers during runtime.

    I'm quite new to this type of application so any advice will be gratefully accepted.

    Best regards,

    Mattias Ottosson

    You can speed up the database write by using bulk insert statements. This can be done in 2 ways.

    Method 1:

    =======

    1) Keep 2 loops. One loop for datalogging into a text file. Log all your values in a comma/delimiter seperated format

    2) In the other loop, Bulk insert the CSV file into the database using Bulk insert from file command. This loop can run at a very slow rate.

    Method 2:

    =======

    1) Keep 2 Loops. one loop for your control/dataacquistion. In that loop, enqueue the required data into a queue.

    2) In the Other Loop, Dequeue all the elements in the queue and form a Insert Statement like below.

    insert into myTable values (1,'Y',36.00),(2,'N',57.00),(row3),(row4),....(row n)

    and execute this statement. This loop can run at a very slow rate.

    Note: Method 2 is supported by MySQL but not supported by SQL Express.

    In my system, 500 individual Insert Statement take 33 Second to execute but, A single Insert statement with 500 rows takes less than 300 milliSec to execute.

  16. Try the (Alpha Version) PERL-LabVIEW Communication Tool available here, http://jeffreytravis.com/lost/download/LVperl.zip

    QUOTE(aart-jan @ Sep 27 2007, 05:13 PM)

    I have built and run several websites including forms running on the internet toolkit G web server. Unfortunately this is a real antiquated http server with some major limitations and bugs. :headbang: Still, I know of a couple of projects I would really like to outfit with a web interface. I would love to run labview VI, dll or exe files in CGI of another web server (such as Apache or even IIS).

    Does anyone know of any Perl script or something to make other web servers talk to Labview CGI code?

    Or maybe someone has an awsome alternative?

    Aart-Jan

  17. I was using CVS some time back. Tortoise-CVS uses the network connectivity only during "commit" and "update" activity. Rest of the time, user doesnt need any network connectivity. The user can work at his code. If the user wants to commit(crreating the next version without check-in-out activity) his work., at that time only he needs the network.. I believe CVS-NT/Tortoise-CVS (freeware) is the right choice for dynamic connectivity situations..

    QUOTE(rkanders @ Sep 20 2007, 09:52 AM)

    I think it is fairly tricky and only needed if you are not a sole developer.

    I keep my repository and even working copy on a removable mini usb drive (e.g. WD Passport). Usb Drive is fast enough for development, and it makes it easy to develop at work/laptop and at home, and LV does not complain about linking problems. I do make frequent backups of repository and have a duplicate working copies on network that get synched via script/button using SVN update command.

    It would be interesting to know if anyone has a solution for your problem. I have thought about this before and could not come up with anything that could be implemented, especially if more than one developer are involved.

    Reinis

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.