Using labview C code

Hello,
I am a bit confused at writing the C code for the CIN. The3 code labview
gives me is:
CIN MgErr CINRun(LStrHandle var1) {
My code that I need to use needs the string input that IU had sent to the
CIN. What is the actual name of the variable that the string is passed as?
Is it LStrHandle, or var1, or the entire LStrHandle var1? Because my code
uses
messagesend(char), where char must be this variable that labview is sending.
I would apreciate any help I can get. This is the last issue I have with
my project before I can start debugging. Thanks
JMH

JMH wrote:
> Hello,
>
> I am a bit confused at writing the C code for the CIN. The3 code labview
> gives me is:
> CIN MgErr CINRun(LStrHandle var1) {
>
> My code that I need to use needs the string input that IU had sent to the
> CIN. What is the actual name of the variable that the string is passed as?
> Is it LStrHandle, or var1, or the entire LStrHandle var1? Because my code
> uses
> messagesend(char), where char must be this variable that labview is sending.
> I would apreciate any help I can get. This is the last issue I have with
> my project before I can start debugging. Thanks
>
> JMH
Let's first back up and make some changes.
1) Decide how many and the types of inputs / outputs the CIN will use.
2) Create the Controls / Indicators / Constants on the Fr
ont Panel / diagram
2A) NAME ALL OF THESE ITEMS
3) Drop the CIN on the diagram start wiring the items to the CIN
[Right click on a terminal of the CIN and select 'Add Parameter' to get more
terminals]
4) Right click on the CIN and select 'Create .c file'
Now the Variables have names you can understand. IF you skip 2A then LabVIEW
will name
the variables as var1, var2, ......varN for the number of variables
(parameters) you add.
So to answer the question var1 in this case is the string coming into the CIN.
The LStrHandle is the datatype (in this case a pointer to a pointer to the
string ) of var1.
I don't want to offend you but I get the impression that you are not
comfortable
with C code and CINs. These are not for the faint of heart. I would strongly
suggest
you look for another solution to the problem before resorting to using CINs.
Of course if I have misinterpreted here you are more than welcome to send me a
lashing.
Good Luck
Kevin Kent
Attachments:
Kevin.Kent.vcf ‏1 KB

Similar Messages

  • Export Adaptive Filter Toolkit Algorithm To C Using LabVIEW C Code Generation Toolkit

    I want to evaluate the performance of some of the standard adaptive filters & have planned to use "Adaptive Filter Toolkit" from NI. Once the desired adaptive filter is selected I want to implement the same filter algorithm in FreeScale controller.
    I understand that LabVIEW C code generation toolkit exports the LabVIEW code to ANSI C code. However, I'm interested in knowing if this toolkit would be able to export Adaptive filter toolkit algorithm as well (since the underlying IP would be in the form of DLL's).
    Any help on this matter would highly be appreciated !!

    I want to evaluate the performance of some of the standard adaptive filters & have planned to use "Adaptive Filter Toolkit" from NI. Once the desired adaptive filter is selected I want to implement the same filter algorithm in FreeScale controller.
    I understand that LabVIEW C code generation toolkit exports the LabVIEW code to ANSI C code. However, I'm interested in knowing if this toolkit would be able to export Adaptive filter toolkit algorithm as well (since the underlying IP would be in the form of DLL's).
    Any help on this matter would highly be appreciated !!

  • I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008.

    I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008. I have selected system target file as nidll.tlc,make command as make_rtw and template nidll_vs.tmf. When I try to generate .dll file I get the following error.
    Attachments:
    SITProblem.JPG ‏101 KB

    Hi,
    No . I could not solve the issue. Presently we are using microautobox (from Dspace)for doing the RCP.
    Himadri 

  • How can I install (download) a Labview FPGA code onto Altera FPGA chip using Labview FPGA module?

    Hi there
    Guys i'm a very new labview user (PhD student), my project is about ( design and implementation of a high speed-yet sophisticated system using Labview environment then install this project's code (using Labview FPGA module) onto Altera-made FPGA chip).
    so kindly, can any body help me in this?...is there any way to connect labview with Altera FPGA?...please anything would be said 'd be of great benifits
    thanks a lot in advance.

    as previously mentioned, labview fpga only supports national instruments targets utilizing xilinx fpgas. the hdl generated by labview fpga is encrypted and cannot be used to synthesize a design outside the labview fpga design flow. 
    however, if you must use labview for your project, it might be possible for you to design the system in labview and use one of the labview embedded modules ( http://www.ni.com/embedded )to generate c code which you can then port to systemc and compile for the altera fpga. i'm not saying it will be easy, but it should be possible. 

  • Using existing c code for usb-hid communicat​ion in labview

    Hello,
    I want to write a simple temperatrue logger using labview and a external hardware which communicates over usb-hid. The external hardware uses an ATMEL 90USB162 µC and DS18B20 sensors.
    Link to the hardware:
    http://www.diamex.de/dxshop/USB-Temperatur-Sensor-​Tester-fuer-DS18B20
    The source of a a simple command line tool is available (see attachement), which reads out the temperature value of the connected sensors.
    Is it possible to include this c-code in the labview application to simplify the communication?
    Thanks a lot and best regards,
    Michael
    Solved!
    Go to Solution.
    Attachments:
    CMDLINE.zip ‏17 KB

    I'm not that experienced at this personally (in terms of compiling C code into DLLs), but I believe the process you need to go down to call your C code in LabVIEW is to compile the C code into a DLL which you can then call from LabVIEW using a Call Library Function node (or you can try to use the "Import Shared Library" wizard to automatically generate SubVIs).
    There's more information here:
    http://digital.ni.com/public.nsf/allkb/DCB90714981​A1F148625731E00797C33
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • G code interpreter using LabVIEW done !!!!!

    I finished my G code interpreter using LabVIEW and I tested , and it gave me excellent results.
    Any one need help, please contact with me.
    ======================================================================
    Khaled Metwally
    [email protected]
    +966540836636

    Hi Khaled,
    I'm Sagar, a Field Application Engineer working for National Instruments, India. At present I'm working with a CNC machine builder in my territory who is interested in using our Motion Control hardware and software tools to build CNC machines. However the customer is demanding for a G code interpreter in LabVIEW that supports 3 axis coordinated motion profile. I would be able to convince my customer to procure our solution only if I can provide him with a G-code interpreter. 
    In this juncture could you please provide me with more information on the G code interpreter you have developed in LabVIEW. Would you be interested in sharing the codes with me so that it would help me better cater to my customer requirements? 
    Awaiting your response. 
    Thank You. 
    Warm Regards. 
    Sagar G Yadav
    Field Applications Engineer
    National Instruments, India

  • How to we use CNC G-CODES in LabVIEW?

    I can't find any G-CODES interpretor for labiew.Anyone can help me? Here is my email for the conversation.
    [email protected]
    Thanks.

    Hi eniscelik,
    About integrating existing G-code into LabVIEW, unfortunately, LabVIEW does not currently have any way to do this, as there are no toolkits or modules designed for this type of application, but  NI has  Alliance Partners who specializes in this type of work.Design & Assembly Concepts, Inc. specializes in motion control and does support these types of applications.
    Otherwise you can keep trying to comunicate with Gharb (link below):
    http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/G-code-interpreter-using-LabVIEW-done/td-p/2...  
    If our developers know our customers are asking for it, they will be able to appropriately prioritize their development time, so I would suggest you to go to our NI idea Exchange (find link below) to provide feedback on G-code support.
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/idb-p/labviewideas
    Regards.

  • TestStand Deployment Error Code 1055 when using LabVIEW Storage VIs

    After a couple of days of playing with the TestStand Deployment. I final tracked down the VI that was causing this Error.
    It was using thethe LabVIEW Storage VIs to save data to a TDM file.
    My work around at the moment is to use a Wrapper VI and call this VI by reference.
    That way the TestStand Deployment can't detect the Storage VIs.
    I'm using LabVIEW 8.6.1 and TestStand 4.1.1 does anyone know if this issue has been address in TestStand 4.2?
    Looks like the upgrade might be worth it.
    Simon Holman
    Software Engineer
    Certified LabVIEW Developer
    Certified TestStand Developer
    measX GmbH & Co. KG.
    http://www.measx.com
    Solved!
    Go to Solution.

    Hi Simon,
    I tested your sequence file in TestStand 4.2 and I didn't get any error! Which version of TestStand do you have? Can you post a screenshot of the complete internal error pop up?
    Usually internal errors can be eliminated with the Clean Reinstall Procedure.doc, where you will remove all NI software and all references to NI software from your computer to start over with a fresh installation!
    I hope these informations help you!
    Best regards
    Suse
    Certified LabVIEW Developer (CLD)
    Attachments:
    Clean Reinstall Procedure.doc ‏32 KB

  • Sending email using labview 8.6

    I am trying to send an email using labview 8.6.But I am getting error 1172  when I try to do so.
    Kindly let me know what modificatons i should do to the port an d server settings.
    I have taken the code from forum only
    I am posting a renamed version of it.
    gmail-1 is its actual name in forum
    kindly suggest me what I should do
    thanks
    Attachments:
    gmail_labview.vi ‏16 KB

    Dear sir,
    I have done as you said and observed that the error is coming at the final node "smtp client-send-message"
    I did not installed any .NET or any other programs.
    A screen shot of the error along with the error node is attached for your reference.
    thanks
    Attachments:
    gmail_labview_error.JPG ‏73 KB

  • How do i open and control other programs using labview?

    I'm presently trying to use labview to try to open and operate another program,but having much difficulty.The external program i'm using is called the Foundation program.
    This Foundation program will use VHDL programming to create a virtual chip and then synthesising it.This program will then simulate the output of this VHDL program to verify that it is working as desired.Then the last stage is to download the whole VHDL program into a FPGA chip using a xilinx cable.
    All this need to be done using a labview program - to open the Foundation program and then extract the saved file and then to execute the download command to cause the VHDL program to be downloaded onto the FPGA chip.How do i go
    about doing all this?What is the first step i must do.Also all this have to be done thru networking..looks like its too difficult..I really need help.
    grays

    I haven't done VHDL so pardon my ignorance.
    LabVIEW can call external DLL via "Call Library Function" or C programs via "Code Interface Node", both located in "Advanced" function.
    If your program is a DOS program, use "System Exec.vi" found in "Communication" function. If you need to format your DOS command prior to sending it, use the "Format Into String" function in "String" function palette.
    Lastly, if you're trying to extract data, assuming it is text, use "File I/O" functions. If the data is binary, use "File I/O -> Binary File VIs".
    Hope that answers most of your questions.
    Shan Pin Koh

  • How to use property Upgrade Code in detection method "Windows Installer"?

    Hi
    I am a packaging specialists helping our deployment guys to add our software (100rds of installers) as application entries in SCCM 2012. The methods supplied by SCCM seem however quite generic and limited.
    The detection method "Windows Installer" is hardcoded to use the Product Code, why?
    Normal detection of Windows Installer packages are done using the Upgrade Code and the Product Version. Is it possible for us our self to add/reconfigure to use that method or are we forced to use the custom detection method?(both those methods should be provided
    by SCCM to better match Windows Installer architecture)
    Ps. It says in http://technet.microsoft.com/en-us/library/bb632336.aspx for Version that "This
    must be in the standard Windows Installer four-part version number format.", but the version number is 255.255.65535 (which is real stupid) as described by http://msdn.microsoft.com/en-us/library/aa370859(v=vs.85).aspx. Ds.
    Regards
    Pär

    Under LV 7.1 with DSC installed I get the same error code (-2147418113) but "explain error" gives me this.
    "LabVIEW DSC:  (Hex 0x8000FFFF) Catastrophic failure."
    This prompts the question is it possible to set an activeX object running in a container for Full Screen.
    This is probably a Q for MS.
    If it look like it is possible, try to get a VB example and that will tell us what we have to do to make this work.
    Ben
    Message Edited by Ben on 10-31-2005 04:45 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • I want to play video on my computer to make some analysis to frames,the problem that I face ,I can't change video frame rate using labview,but I can change frame rate to the video out of labview using some program

    HI All
    I want to play video on my computer to make some analysis to it's frames,the problem that I face ,I can't change video frame rate using labview,but I can change frame rate to the video out of labview using some program .
    I used IMAQ AVI Read Frame VI
    for example I have avi video It's frame rate is 25 fbs ,my image processing code is very fast that can process more 25 fbs,so I want to accelerate video acquisition

    Hi abdelhady,
    I looked into this further, and reading an AVI file into LabVIEW faster than its frames per second won't be possible. LabVIEW could read in frames faster than 25fps, but because it will be pulling the available frame at that point in time this would just give you duplicate frames. If you want to be able to read in frames at faster than 25fps, you would need to speed up your AVI file before reading into LabVIEW.
    There's a good shipping example to show how to read in from an AVI file, "Read AVI File.vi". You'll notice that they add timing to make sure that the while loop runs at the right speed to match up with the frames per second of the file being read. This is to make sure you're not reading duplicate frames.
    Thank you,
    Emily C
    Applications Engineer
    National Instruments

  • How to create a dataplugin for DataFinder using LabVIEW

    We want to use LabVIEW to create a dataplugin that will be used by DataFinder (My DataFinder). We have found on the NI web site the LabVIEW DataPlugin SDK - , a SDK that allow us to create a dataplugin. The SDK is for LabVIEW 8.6.
    The dataplugin example code of the SDK work very well in the “For testing” section of the development project. We are also able to register it to use it through DataFinder. The dataplugin is available in the “Configure ...” window of DataFinder.The problem is that the dataplugin doesn’t work with DataFinder. We didn’t receive any kind of error message or code. We only get the value “eIndexedFailure” in the “Index status” property. After expectation, it seems those input parameters are different between a LV and a VBS dataplugin. And we think that can be the source of the problem. There is someone that can help us about that?
    We also want to use LabVIEW 2009. The SDK example work under 2009, but we get the same problem with DataFinder.
    Thanks
    Solved!
    Go to Solution.

    Dear Kelly R, you're right I can’t open the file in DIAdem. The RegisterLabVIEWDataPlugin.ini file is correct. But I’ve just tried to rebuild the project and then use the Installer instead of just using the Deploy. Now it works, even with my own code. Now I can open the file in DIAdem without problem. The installer uses the “NI LabVIEW Dataplugin 1.0” package. It seems that the SDK installer has never install this package.I thank you all for your help. 

  • 100% CPU using LabView 7.1 and DSC module

    Seven years ago I used BridgeView and PXI to execute a project, and the results were so good that after that initial system, I installed one more using BridgeView, and three more using LabView 7.1.
    BridgeView is working very well, but lately, LabView 7.1 is giving me more and more problems. It all started in a system running LabView 7.1 and DSC on Windows XP, using a PXI-8187 controller with a PXI-1042 chassis. I have two PXI-6533 digital I/O boards, one PXI-6030E multifunction, one PXI-6713 analog output board, one PXI-6602 counter board and one PXI-8422 serial com. board. In may/06, all of the sudden, the CPU went to a 100% use. Since I am running PID's to control a flash-butt welding machine in a steel factory, this was extremely dangerous. I changed the controller and everything went back to normal. It was running fine until december/06, when the same behavior appeared again. This time changing the controller did not help. We increased the system memory, from 256 MB to 512 MB and everything worked fine. But one month later (january/07) the fault reappeared. This time we changed the chassis and from that moment to this time, we are running smoothly.
    Application problems were suspect from the very first time this problem appeared, but I was unable to identify the source, if any. I used PROFILE VI's and apparently the write/read tags were taking all the processor resources. However, changing the routines and disabling communications, and optimizing CPU intensive programs never solved the CPU overload.
    Until now, I was aware of only one system showing this erratic behavior. But today I went to check another system, with a totally different application. This one is used to measure the thickness of the steel sheet on a rolling mill. Is not so resource-intensive, but the maintenance folks told me that every time they turned off this particular system, they always had problems trying to turn it on.
    I was suspecting of a PLC-communication related issue, but what I found turned my alarms on. I turned off the system, which was fully functional, and turned it back on, and there it was, CPU load at 100%!. Is exactly the same problem that I have on the welder. This system has a PXI-8184, a PXI-1042 chassis, Windows XP, one PXI-6030E, one PXI-6713 and one PXI-6533. I battled for 20 minutes to put the system back in normal conditions.
    I specified every single board, installed everything and programmed all the applications. The BridgeView applications have never showed anything like this. I am using the DSC (Datalogging and Supervisory Control Module) on both applications, and the Lookout Protocol Drivers are communicating to Modicon PLC's.
    Please, I need help to solve this issue. I believe none of your actual Knowledge Base "100% CPU" articles apply to my case...
    Thanks in advance...
    Antonio Jimenez
    [email protected]

    Thanks for your reply...
    Yes, sometimes I have the feeling that the systems works again because some file or database gets initialized after so many reboots.
    Intentionally I turned off all the events and alarm logging to disk. Also the historical data logging is disabled. This is done by code, every time the main VI is started. This was included precisely to save CPU processing power. However, I am communicating to PLC's, and of course I have to declare variables inside the citadel database to make the communication possible.
    Right now I can't have access to the application, because the mill is rolling, but during the next maintenance stop I will check the database location and size, and I could change the directory location the next time the fault comes up.

  • How to transfer file from PC to PC via serial port using labview

    I need to transfer files(.txt, .doc, .xls) from PC to PC via serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?
    Solved!
    Go to Solution.

    Yes, it is possible to transfer files with the serial port using LabVIEW.  Files are just collections of bytes and the serial port is pretty good at shipping bytes from one PC to another.  You need to connect the serial ports together with a null modem cable.
    First, take a look at the example for serial communication.   In LabVIEW, go to the Help menu and select "Find Examples...".  From there you can search for "serial" or navigate to Hardware Input and Output >> Serial.  Select the "Basic Serial Write and Read.vi".  Experiment with that example to gain confidence on the serial communication methods.
    Next, it's time to learn about how to read and write files.  For that, the examples could be somewhat confusing since they all deal with files that are presumed to have data of a specific type in them.  I would recommend just getting familiar with the functions on the File I/O palette.  Specifically, get to know the following functions.
    Open/Create/Replace File - On your destination side, you'll need to create the copy of the file that you are trying to transfer
    Close File - When you are finished reading from or writing to a file, you should close it.  It cleans up the memory being used and finalizes any write operations that are still floating in the write buffer.
    Read From Binary File - The best way to read from a file when you do not really care what type of file it is.  In your case, you just want to get those bytes read and sent out so they can be written down at the destination.
    Write to Binary File - At the destination side, this is what will store those bytes to the file you created with number 1.
    Get File Size (under the Advanced File Functions sub-palette) - You need to know how big the file is so you know when you are finished.
    OK, so once you are able to create files, write bytes to them, and read bytes from existing files you can move on to transferring.
    The basic method I would suggest is to have the user specify a source file on the source PC and a destination folder on the destination PC.  Then, find out the size of the source file using number 5.  Divide that size number by the number of bytes you feel like transferring at once.  The serial buffers are usually around 32k (if I remember correctly) so do not exceed that.  Now begin sending data by reading some number of bytes and wiring that string output to the VISA Write function.  On the destination side, you'll want to be monitoring the serial port for bytes and reading them when they arrive.  Wire that string to the Write to Binary File function to add them to your destination file.
    That is the basic outline of how to do it.  You have to be careful not to overload the write and read buffers on the serial ports.  Initially you can use delays on the sending side to make sure the reading side has enough time to digest.  To get things moving faster, you can bring in some flow control.
    If all that sounds a bit intimidating, there are Alliance Member companies out there (such as PrimeTest Automation) who can write such code for you and even provide a turnkey solution for you.
    Happy wiring,
    Dan Press
    Certified LabVIEW Architect
    PrimeTest Automation

Maybe you are looking for