How does LabVIEW convert string to char* when passing them to a Call Library Node?

I have a program which calls C++-based libraries which themself use external libraries (Qt). I pass strings to my library through the Call Library Node, and was wondering how the formatting goes? I have to interpret the char* according to Latin1, UTF-8, UTF-16, ... to convert them to a string which the Qt libraries understand. I need to use char* instead of LV strings, because the library is indepent of LabVIEW.
It seems that interpreting the char* as Latin1 (default) does not work on Korean systems (for one of our customers), which is understandable when you know that the Latin character set does not know Korean signs. Anyone knows how the char* should be interpreted then? In other words, for non-Latin languages, what exactly is passed to the DLL?

I don't think that we reinterpret your string in anyway, just reformat the data so that it can be passed to your dll. 
So assuming you are getting text from, say, keyboard editing, the text should be in the ANSI codepage that the system is running under.  That is, if you are running Windows using an English locale, it will be codepage 1252 (Windows Western, Latin 1), if you are running Windows with a Korean codepage iirc it will be codepage 949, Unified Hangul code.
If you are filling the string with data that you get from an instrument or some other fashion, it could really be anything.
Here is a list of the codepages that Windows knows about
http://msdn2.microsoft.com/en-us/library/ms776446(VS.85).aspx
I do have some experience with Qt as well, and I think that the function you are looking for to create, say, a QString from this is:
QString::fromLocal8Bit
but I am not 100% certain about this as I am not a Qt expert.
Jeff Peters
LabVIEW R & D
Message Edited by jpeters on 04-02-2008 12:38 PM

Similar Messages

  • How does labview create a hyperlink in a web page?

    Hi
    I was wondering, how does labview create a hyperlink in a web page?
    Thank you.

    Hi,
    What do you wish to do?
    The most primitive way is to generate a .HTML file.
    Type your HTML codes (Using string constant) and save it using "Write Chars To File.vi" using a filename with extension .html
    Hope I am addressing your question.
    Cheers!
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com

  • How does Labview support redundancy?

    I have a control system and Labview will act as the means of control/monitoring. However, I want to have a primary and secondary computer with duplicate system setups. How does Labview support this type of redundancy such that if the primary goes down, the secondary will take control seamlessly.

    Hi,
    LabVIEW has many capabilities that can be combined to create a very robust redundant system. Some of these features include the following:
    Archiving databases periodically
    Monitoring a process on a remote machine
    Executing an application on the backup when the primary has failed
    The most straight forward method of implementing the monitoing is to use discrete memory tags to create a heartbeat. When the heartbeat on the Primary machine has stopped, the backup should take over and begin execution.
    If you have specific questions about how to implement this, feel free to call support by going to www.ni.com/ask.
    Regards,
    Mike

  • How does the Convert Command Work Under the Catalogue Manager?

    How does the Convert Command Work Under the Catalogue Manager?

    My suggestion would be that you download the pdf version of the organizer help file:
    http://helpx.adobe.com/pdf/elements-organizer_reference.pdf
    Start with page 57 for catalogs.
    I am sure you'll have a better understanding of backup/restore and converting when you understand what a catalog is.
    Please come back with your questions afterward .

  • How does labVIEW use ActiveX controls?

    How does labVIEW use activeX controls?
    I recently wrote an activeX control in VB and noticed that it would not work if the control was set so that its properties could not be set in ambient mode. This may suggest that labVIEW uses some activeX controls only in ambient mode.
    Is this the case or are there more complexities?

    Dan,
    Which version of LabVIEW do you have?
    As per the KnowledgeBase bellow, in versions of LabVIEW prior to 5.1 you would get errors accessing the ambient properties.
    ActiveX Controls in LabVIEW 5.0.1 Containers Cannot Access Ambient Property
    Do your controls use the Ambient.UserMode to determine when the control is being used in a development environment? When embedding ActiveX controls into a container on the front panel, by default, the ActiveX control generates and responds to events, i.e. it is running, even when LabVIEW is in edit mode.
    Right-click an ActiveX container and select Advanced»Design Mode from the shortcut menu to display the container
    in design mode while you edit the VI. In design mode, events are not generated and event procedures do not run. The default mode is run mode, where you interact with the object as a user would.
    Information can be found in the LabVIEW help files
    Zvezdana S.

  • How does one convert an HP/Adobe scan into editable WordPerfect?

    How does one convert an HP/Adobe scan into editable WordPerfect? 
    The writer does not understand computer-eze.  Please explain in simple English.

    You can try using Adobe ExportPDF (https://www.acrobat.com/exportpdf/en/home.html) though it only produces Microsoft Word files. If WordPerfect can import .docx files, that will work. Note that the ability for ExportPDF to convert the file depends on the quality of the scan. If it's hard for ExportPDF to interpret the scan due to smudges, fuzziness, etc., it cannot do a very good job.

  • How does one convert pdf to excel

    how does one convert pdf to excel

    Use Acrobat and choose Save As -> Spreadsheet -> Microsoft Excel

  • Why does the DLL function executed by call library node fail when the Vi is re-opened?

    Development System
    OS: Windows XP
    LabVIEW: version 10.0
    DLL: Custom 
    Compiler: Visual C++ 6.0
    Function Prototype: __declspec(dllexport) const char * test(void)
    We have developed a DLL for use.  The DLL compiles cleanly.  The DLL includes a function test.  The test function validates the functional capabilities of the DLL.  I have followed the examples online, and I have used the import shared library tool in LabVIEW.  The VIs created use the call library node. 
    When I create a VI calling the test function from the custom DLL using the call library node the VI executes the DLL function test flawlessly.  I close the VI.  When I re-open the VI and run it, I get an error code from the DLL.  However, if I go to the block diagram and set the path for the DLL in the configure call library node again then the VI executes the DLL function test flawlessly again. 
    I have to set the path for the DLL in the configure call library node every time I open the VI.  The examples I downloaded from the community do not require this.  What might the DLL be missing?  What am I missing? 
    Solved!
    Go to Solution.

    I think it was rather unfair of me to ask for help with my DLL issue without disclosing more detailed information.  As a corrective action, I have attached a zipped file.  The zipped file contains the entire VC++ 6.0 project for compiling the DLL, the DLL, and the VI I have been using to test it. 
    ###NOTE####
     As a prerequisite to compilation and usage of the DLL you'll need to have installed Python 26 on your system.   
    You may obtain the MSI for correct version of Python from the following location:
    http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi
    ###NOTE###
    Thank you very kindly for any assistance offered!
    Thanks,
    Bill
    Attachments:
    C_DLL_PYTHON_AND_LABVIEW2010.zip ‏1685 KB

  • How do I fix a Call Library node with an unwired or bad terminal?

    I am currently working on a program that's designed to both send and recieve analog data to/from a BNC 2090. Somewhere along the line, LabVIEW came across a problem in the Call Library Node in the Create AO Channel.vi. Because of this, most of the important subVI's don't work anymore. I've attached the file I'm working on. How would I go about fixing this unusual problem?
    Solved!
    Go to Solution.
    Attachments:
    voltageex.vi ‏230 KB

    mecheng86 wrote:
    I am currently working on a program that's designed to both send and recieve analog data to/from a BNC 2090. Somewhere along the line, LabVIEW came across a problem in the Call Library Node in the Create AO Channel.vi. Because of this, most of the important subVI's don't work anymore. I've attached the file I'm working on. How would I go about fixing this unusual problem?
    Maybe Just maybe the problem is that dynamic data type cast
    the DAQ assistant is set for continuous samples and "Use Waveform timing" is checked.  you have a scalar DBL wired to the assistant for data.  Just where do you think Samples per channel and dt are going to be coming from?  Kind of hard to get them from the Size(Y) and dt components of a scalar.
    Jeff

  • Getting error in call library node when establishing communication with MAX1452 on serial port using dll

    I want to communicate with MAX1452 in labview on PC serial port. Maxim provides dll file which has functions to communicate with device.It says first two functions should be findcom port and initialization sequence where findcom port returns PC's serial port address while initialization sequence helps device to learn baud rate.Iam not getting exception error in call library node.i have kept dll file in the same location as VI.

    Labview verison is 7.1 and os is win xp.
    The data types are according to the dll functions defined in functions definitions( attached previously).
    I'd put dll in the same directory where the code resides.
    Attachments:
    Code.vi ‏23 KB

  • How do i convert String type to an BinaryEntry Type ?

    We have to differentiate between keys that come to Erase method of custom publisher. So, we appended "|" at the end of the key as below
    key = "a"; //Actual key that is in Cache
    if(//some condition)
    newKey = "a|"; //newKey to differntiate
    getCache().remove(newKey);
    else
    getCache().remove(key);
    Now, the call comes to Erase method of our custom publisher. Here, we need to perform different operation for the key which has "|" in it. So, we added below code in custom Erase method.
    public void erase(BinaryEntry binEntry)
    String key = (String) binEntry.getKey();
    if(key.contains("|"))
    //Need to perform some DB operation here. Then,
    //now the key is "a|". we need to remove the "|" symbol and call erase method to remove the actual key ("a") from cache. So we added below code
    String newKey = (dnsDomainName).replace("|", "");
    //Here the problem is, key is of type String. But, Erase method can take only BinaryEntry type. So, we tried this
    binEntry = (BinaryEntry)(binEntry.getContext().getKeyToInternalConverter().convert(key));
    super.erase(binEntry); //but it dint work. The entry is not getting deleted from Cache.
    //How do we convert the key that is of String type to BinaryEntry ?
    else
    super.erase(binEntry);
    Can someone suggest ?

    LSV wrote:
    We have to differentiate between keys that come to Erase method of custom publisher. So, we appended "|" at the end of the key as below
    key = "a"; //Actual key that is in Cache
    if(//some condition)
    newKey = "a|"; //newKey to differntiate
    getCache().remove(newKey);
    else
    getCache().remove(key);
    Now, the call comes to Erase method of our custom publisher. Here, we need to perform different operation for the key which has "|" in it. So, we added below code in custom Erase method.
    public void erase(BinaryEntry binEntry)
    String key = (String) binEntry.getKey();
    if(key.contains("|"))
    //Need to perform some DB operation here. Then,
    //now the key is "a|". we need to remove the "|" symbol and call erase method to remove the actual key ("a") from cache. So we added below code
    String newKey = (dnsDomainName).replace("|", "");
    //Here the problem is, key is of type String. But, Erase method can take only BinaryEntry type. So, we tried this
    binEntry = (BinaryEntry)(binEntry.getContext().getKeyToInternalConverter().convert(key));
    super.erase(binEntry); //but it dint work. The entry is not getting deleted from Cache.
    //How do we convert the key that is of String type to BinaryEntry ?
    else
    super.erase(binEntry);
    Can someone suggest ?Excuse me, but you write here totally does not make sense on its own.
    1. What class is this method on?
    2. Why do you want to use a key in the place of an entry?
    If I correctly interpret what you try to achieve, your super-class implementation has to know how to deal with the trailing pipe character as you are never supposed to change the key on an entry, and the entry without the pipe does not exist either.
    Best regards,
    Robert

  • How can I convert string to the record store with multiple records in it?

    Hi Everyone,
    How can I convert the string to the record store, with multiple records? I mean I have a string like as below:
    "SecA: [Y,Y,Y,N][good,good,bad,bad] SecB: [Y,Y,N][good,good,cant say] SecC: [Y,N][true,false]"
    now I want to create a record store with three records in it for each i.e. SecA, SecB, SecC. So that I can retrieve them easily using enumerateRecord.
    Please guide me and give me some links or suggestions to achieve the above thing.
    Best Regards

    Hi,
    I'd not use multiple records for this case. Managing more records needs more and redundant effort.
    Just use single record. Create ByteArrayOutputStream->DataOutputStream and put multiple strings via writeUTF() (plus any other data like number of records at the beginning...), then save the byte array to the record...
    It's easier, it's faster (runtime), it's better manageable...
    Rada

  • How does iTunes prioritize loading to iPod when more than 5 accounts?

    Unfortunately, my absent minded son has opened up multiple accounts (4 as a matter of fact) when he has received iTunes cards, not knowing (until now) that his ipod will only take 5 accounts max. Given that his two sisters and I also have accounts, we have 7 on the same library. He does not sync the whole library and we have gone through his playlists to exclude his sisters' songs (which is an ordeal all on its own). I then reset his ipod and synced his playlist first, so that his four accounts and mine would be the ones which were loaded onto his ipod. This seemed to work until we included "music videos", which included some of his sisters' videos. I had assumed that they would not be loaded because the 5 accounts had been filled, but they did and the songs from his two most recent accounts were "de-synced". How does iTunes prioritize the 5 accounts and how can I make sure the 5 that we want are the ones loaded? Thanks in advance,
    Kevin

    i know you can only register 5 computers to use ipod
    This is incorrect.
    You can authorize a max of 5 computers to play your iTunes purchases.
    how do i get rid of the accounts registered to my ipod
    Accounts are not registered to an iPod.
    Tp play songs in iTunes, you need to authorize teh computer. To authorize teh computer, play a purchased song. It will tell you that you need to authorize the computer by inputting your username and password.

  • How does OWB deal with bitmap indexes when inserting?

    How does OWB 9.2 deal with bitmap indexes on a fact table when records are inserted from a staging table? It seems to me that they are left on the table, while in the 9i Server manuals it says that one should not perform heavy DML in this case, because this slows down the inserts considerably and the indexes can get bloated. Should one define a premapping and postmapping process for removal and recreation of the bitmap indexes?
    How handles OWB bitmap indexes in case of PEL and what action should one take then?
    Jaap.

    Hai Japp,
    It depends on the volume of the data.
    The best way is drop index in pre mapping process and recreate it in post mapping process.
    You need to use EXECUTE IMMEDIATE command in the procedure to create or drop indexes.
    e.g:
    EXECUTE IMMEDIATE 'CREATE BITMAP INDEX INDX_BI_TABLE ON TABLE_NAME(COL_NAME)'
    Regards,
    Malli

  • How does labview use nce files

    I have been using MAX sometime ago but did not make full use of it.
    - How can I use labview to communicate with nce files?
    - Does Labview communicate with MAX?
    And I cannot find the document knowledge base to using MAX?
    Only I can find in the help files but not enough. I need more info, 
    regards,
    Clement

    astroboy,
    Here is a knowledge
    base article discussing the possible reasons for your error. 
    Also, try and start
    with some of our shipping examples. 
    After importing your MAX configuration I used Cont Acq&Graph Voltage-Int Clk.vi and everything ran just fine.  You can get to this example by
    going to Help>Find Examples.  Then go
    to Hardware Input and Output > DAQmx > Analog Measurment > Voltage.
    Ryan N
    National Instruments
    Application Engineer
    ni.com/support

Maybe you are looking for