LabVIEW Programming for running the machine continuously - labview

I want to run my Robot in 3 -axes(X,Y,Z) continuously with different values of
x, y, z. Suppose i want the machine to run 100 times. Each time the values of the x, y, z will be different and each time it will take the values from a table automatically so that while running the machine i don't need to change the values each time. How is it possible in Lab VIEW? I am using Lab VIEW 2011.

If you save your spreadsheet in CSV format, you can then read it into a LabVIEW array using Read from Spreadsheet File in the Programming > File I/O palette. You can then use the array functions in the Programming > Array palette to get the subarrays you need out of the first array. If you want to run the same code multiple times using different values from the spreadsheet then you will probably want to use a For or While loop.
If you carefully read the online help for these functions and try experimenting with them you should be able to work out how to do what you need. If you can't get it to work properly, post a screenshot or (better) VI snippet showing what you have tried and people will be able to offer more specific help.
LabVIEW doesn't have functions to read directly from Excel spreadsheet files, but there are third-party add-ons to do this if you want.

The best way for you would be to start learning LabVIEW little bit dipper before writing the code.
Anyway, you can use read from spreadsheet file.vi. Hope the links below will be helpful:
http://zone.ni.com/reference/en-XX/help/371361J-01/glang/read_from_spreadsheet_file/
https://decibel.ni.com/content/docs/DOC-12287

Related

VBA to automatically print page ranges of a PDF

At work, attached files size to email is limited to 10 Mo and because of many reasons :
Outlook is the only way to share files
I can only use the programs already installed
I am trying to create a VBA macro to :
automatically split PDF bigger than 10 Mo by printing them into smaller files
merge them on the other side
I know it is far from ideal (and many tools exists to do it), but I have no other options.
So far, it seems that I can only use PDFCreator and Adobe Reader for this task, as no other helpfull tools are deployed on my PC (mostly Office)... and I can not figure a way to use command line for printing range of pages.
I successfully created a working (very) inelegant macro, based on Shell commands and SendKeys VBA, basically emulating human interaction to print range A, then waiting for the job to be done, them printing range B, and so on... Among the many problems I should now solve :
add protection to take into account machines with different processing power (replace my timings with file creation verification and detect if jobs are still running in the background)
create a robust merging system when receiving the mail
Plus I am very dependant of the software versions installed, and I foresee a lot of issues with software updates/version if this macro is to be used by many people.
So this method doesn't have a bright futur for now, and unless I find an other way to solve this problem, I will probably give up and keep doing this manually (after all, if my employer doesn't provide better tool, I should not be expected to be as efficient as I could).
Have you any insight about how to cleverly solve this issue ?
(Yes, I already told my boss that working like this is a nightmare, but easy file exchange is not the priority).
I managed to solve my problem using 7-zip and its "-v" option using command line : I split my big file into binary smaller files and automatically create new mail with them as attachments.

Zebra .zpl file backwards to designer

I am still learning zpl. I have created some simple labels using the Zebra designer and converted them to zpl files and added to printers. Now, I have been tasked to update existing labels for some of our customers and I do not have the file available in the designer. I have been successfully been able to do things like update a barcode type and add a field by directly updating the script. But, the changes the users want would be much easier if I could use designer (I know that is like cheating!). But, the timeline I have is short. I have found some older questions out there that say this is not possible, so I thought I would check to see if it may now be possible to use the script on the zebra printer, and convert it to text that the designer will recognize.
I would like to mention that the printers I work with are physically located in other countries, with most inside restricted manufacturing production areas. When testing, I have to coordinate with users who have access to these printers. This means that printing one label, and then receiving a picture of this label can take several hours. I am still waiting for results of one test we did yesterday! Thanks to this site, I have found a site on line that will kind of mimic the label, but the actual printed copy is the best test.
Thanks for your attention.
You cannot import the ZPL back into a designer, but there are two tools that are very helpful when you don't have a printer to test with:
Labelary Online ZPL Viewer
Chrome ZPL Plugin
I've used both and have been pleased with the results, but your experience may vary depending on the complexity of the label.

Labview 2012 Passing Dynamic data into/out of a while loop

I'm trying to pass data which is continuously changed from the inside of one While loop to the inside of another While loop of a sub-vi. The main program on the left is constantly reading new data and the program on the right is adding 1 to the new value. My issue is that I cannot input new values to a While loop which is already running and thus my sub-vi is never updated. I've tried a global variable ("write" from the main program control and then "read" into the sub-vi) but that doesn't work either (same result as if the main were just passing data into the sub).
I apparently don't have enough reputation to post a picture of my program but I'm basically trying to run parallel loops (almost inside each other). Can anyone lend me an experienced hand?
The most common problem with while loops are based on lack of knowledge how exactly does the while loop work in LabVIEW.
First of all the information will be given outside the loop only if the condition terminal (right down corner of the loop) will be flagged as true.
If you want to pass the data earlier (while the loop is running) you have to choose easiest option:
Use queue (is the most common and well working). I can elaborate how this one work in practise if you want, or just try to run an example from LabVIEW help.
local/shared variables - you can define in your own library variables and pass the data by READ/WRITE option.
Please try to upload some documentation to an external server (as you are blocked here), and post a link, and then I could help you with a specific example.
HelpĀ»Find Examples. Search for "queue". Pick out an example with parallel loops.
You might want to look into Queues or Notifiers as means of passing data between running loops.

Use Excel solver with calculations by an external program

Currently, I have a spreadsheet which uses an external program to do calculations (let's say it's an aerodynamic calculation tool). In Excel VBA, I update the inputs to the program via a UDF at the spreadsheet level ( =input("var1",1.234)).
Then, using VBA, I write the input file, run the external .exe, and read the output file. Outputs are again reported to the spreadsheet level via a UDF (=output("var2"))
I would like to use the Excel Solver function to make an optimization of the spreadsheet. Here, I would like it to change the input values ( via the =input() function) to get the optimum in the outputs (via the =output() function). The solver should be able to change the inputs, wait for the new calculation to be made (via the external .exe) and then resume when it gets the outputs.
So far I've found no reliable way to make it work. The Excel solver does not know that it needs to wait for the .exe to finish, even when I embed the shell(.exe) command in the input UDF....the solver still plows through as if nothing was happening.
Expectedly, it comes up with bunk since the output is out of sync with the input. I've pried open the SOLVER.XLAM (...ahemm..) to find a way to insert a wait statement, but that wasn't much help; the interface ends where the VBA interfaces with the SOLVER.dll, which places hooks into Excel to run the Excel calculation directly from the .dll ...so no help to me.
So far I'm stumped. Nobody seems to have encountered this before. I've tried looking into OpenSolver.org version, but they also end at some mysterious .dll or .exe interface. Any ideas?
(BTW: I have no access to the external program code, if you're wondering.... an .exe and some text files is all I get).
OpenSolver should work if you use the NOMAD solver, which does all calculations directly inside the spreadsheet. See http://opensolver.org/non-linear-nomad-integration/ for more information.

Labview diagram creation API

I need to drive a testbench with labview.
The test scenarios are written in a languages that can be automaticaly translated into labview diagrams.
Is this an API that allow to create "labview diagrams" from another software ? or with labview itself ?
I agree that LabVIEW scripting is one approach, but let me throw out another option.
If you are planning to do a one time migration from your test code to LabVIEW than scripting is great, but if you plan to regularly update your test code (because it's easier to use the "test" language than LabVIEW) than it could become quite painful to constantly perform the migration every time your test code has changed.
I've had great success with simply putting my state machine inside of a for loop and then reading in "commands" from a text file that was generated using my "test" language (see pic).
For example, to do an IV sweep my text file might say something like:
SourceV, 5
ReadI
Wait, 1
SourceV, 6
ReadI
This image is greatly simplified - I'm not using a state machine and I don't show how to use "parameters," but I can provide a more comprehensive example if needed. Again, I've had great success doing this with around 30 "commands" controlling multiple instruments and then I generated the text input using VBA or Python.
It's called LabVIEW scripting. You will need to enable an option in the VI Server page in the options dialog to see the relevant features.
A few things to note:
Scripting isn't complicated, but you do need to be aware of how LV code is built.
While scripting is public, it was initially created as an internal tool. There are still corners of it which are incomplete.
Scripting code can be tedious. If you can get away with it, try creating templates of code.
NI has something called CodeGen, which I believe are a series of functions which make some scripting easier, although I never really looked into it.