Can I write arrays of strings to OPC server?

I am using shared variables for their built-in OPC server functionality.  I have configured some of my SVs as strings, as arrays of doubles, as arrays of booleans, and as arrays of strings.  When I connect to the NI shared variable engine using the MatrikonOPC Explorer OPC client application (a free app recommended for OPC troubleshooting on the NI website), I see data for all of the shared variables EXCEPT the SVs that happen to be arrays of strings, which show no values and a quality of "Uncertain, non-specific".  If I use DataSocket to connect to the same SVs using their OPC URL, I see the same quality result (Quality=64).  Is there something I need to do to ensure that SVs configured as arrays of strings work properly as OPC tags? (string lengths?, termination characters? etc).  In MatrikonOPC "Array of Strings" is listed as a possible Data Type, so I assume that what I'm trying to do is not impossible. The reason I'm trying to have OPC tags as arrays of strings is because my system has a variable number of channels, and I want to transmit the channel name list to an OPC client.  Does anyone have experience with this?
NI Software :  LabVIEW  version 8.6.1
OS :  Windows XP

I've downloaded a couple of free OPC client apps (MatrikonOPC and CAS OPC) and they both seem to list an array of strings as a possible data type, though I can't say if that is a commonly implemented one or not.
You are correct that I would like the LabVIEW shared variable engine to act as an OPC server in my application.  Data will be acquired on the PC running LabVIEW, and written to OPC tags for sharing with another PC on the network.  I'm actually not positive what the client application will be, since it will be supplied by the customer that is purchasing the software.  It might be Wonderware, but I'm not 100% on that.
If I am unable to solve this problem then I guess I can always create a separate SV/OPC tag for each DAQ channel and pass data that way, rather than my current method of creating only two SVs: one that is an array of channel names (strings), and one that is an array of channel values (doubles).  It just seems a bit inefficient to create a whole bunch of OPC tags that may or may not be used, since the number of channels enabled and their names will all be based on a user-supplied configuration that may change from one run to the next.  I'm not much of an OPC expert though, perhaps creating a whole mess of OPC tags is the normal methodology that people use.

Similar Messages

  • How can i write a sign string in VISA Write?

    Hello everybody.
    I would like someone to help me. I have an
    array, which is transformed (by Byte Array to String) in a string that
    reaches the VISA Write Serial Port. My problem is that when making the
    transformation with Byte Array to String, i  lose all the bytes with sign
    (negative).
    What can I do? I don't want to  lose the sign bytes and be able to send them to VISA Write Serial Port.
    Thank you very much.

    It sounds like you have a typecasting problem.  First, why do some of your bytes have a sign?  I assume they are I8.  Strings are based on U8 because they are just a series of ASCII characters vs. values.  The ASCII character table goes from 0 to 255.
    What happens on the other end of the VISA communication string?
    One thing you could do is to typecast your bytes to a U8.  Though I think the coercion dot of an I8 byte array going into the byte array to string is doing this automatically.

  • How can I return Array of String to client

    Hi all,
    I am a new learner about web services, can any one tell me how to return of get a String of array from OMElement ?
    I have two server side method want to create, first method receive an array of string and second method return an an array of String. How should I implement it.
    public org.apache.axiom.om.OMElement OneWayRequest() {
              //How Please help me
    public void LoadDummyNumberForInventory(
         org.apache.axiom.om.OMElement loadDummyNumberForInventory0) {
    //How get the String array ?
    }

    Hi all,
    I am a new learner about web services, can any one tell me how to return of get a String of array from OMElement ?
    I have two server side method want to create, first method receive an array of string and second method return an an array of String. How should I implement it.
    public org.apache.axiom.om.OMElement OneWayRequest() {
              //How Please help me
    public void LoadDummyNumberForInventory(
         org.apache.axiom.om.OMElement loadDummyNumberForInventory0) {
    //How get the String array ?
    }

  • Write String in OPC server

    Hello im using Labview 8 an I'm a newbie with that Program
    I want to write a String or a date in a OPC Server
    Is that possible with Labview, if yes could you tell me how it will work
    Regards
    Densel

    hi there
    sure, that's possible!
    use the functions from the "DataSocket" palette. Use the "DataSocket Open" function to open a connection once at start of the app, then the "DataSocket Write" function whenever you want to write data and the "DataSocket Close" function at the end of your app to close the connection. right click "Help" on the functions to learn more or search the examples for "DataSocket".
    Hint: there's a llb "dataskt.llb" in the vi.lib. the VIs in this llb are not recommended for future use. use the DataSocket functions instead.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Use Data Socket vi's to write to a custom namespace OPC server.

    Hi there,
    I'm still having the following problem:
    I'm trying to write an OPC tag to my OPC server that is currently not
    existing in the servers name space.
    Normaly (with other OPC clients) the server fires an event that validates
    and adds such unknown tags
    to the server if they are not existing.
    These event is fired through the labview client, too, but unfortunately the
    parameter that tells the server what
    data type the server should use to register the new OPC item is always zero
    (uninitialized variant typ) instead
    of VT_UI VT_DBL or any other value for a valid typ.
    Does anybody know how to register unknown but type save OPC items to an OPC
    server with LabVIEW 6.1 / 7
    data soket vi's ???

    Hello Bryan,
    The BrowseDeviceList VI was released within NI-FBUS 3.2. For NI-FBUS Configurator 3.1, please unzip the attached file and copy the "addon" and "Ff" folders into "\vi.lib" directory. LabVIEW 7.1 or above version is required for using these addons.
    And for your information, there is a free upgrade (version 3.1.1) for NI-FBUS Configurator 3.1 users. Here is the link to the upgrade kit.
    http://digital.ni.com/softlib.nsf/websearch/00A1614EC291219586256F390020671B?opendocument&node=132070_US
    Hope it helps!
    Regards,
    --Josiane
    Attachments:
    locate_fflv_in_labview82.jpg ‏214 KB
    vi.lib.zip ‏391 KB
    locate_fflv_in_labview71.jpg ‏193 KB

  • How can i cast array of string to int ?

                       while(st.hasMoreTokens()){
                                  test[count] = st.nextToken();
                                  count++;
                          }Since token deal with string, i have to pass them into String of array, but how can i convert all of them to int to perform arithmetic operation?

         public static void main (String[] args) throws IOException{
               DataInputStream dis = null;
                 String dbRecord = null;
                 int tokenCount = 0;
                 int numOfQuestion = 0;
                 int questionnAireNum = 0;
                 int postCode = 0;
                 int age = 0;
                 int gender = 0;
                 String [] response = new String[10];
                    File f = new File("polldata.txt");
                    FileInputStream fis = new FileInputStream(f); 
                    BufferedInputStream bis = new BufferedInputStream(fis); 
                    dis = new DataInputStream(bis);
                    // read the first record of the database
                    while ( (dbRecord = dis.readLine()) != null) {
                       StringTokenizer st = new StringTokenizer(dbRecord, ",");
                       tokenCount = st.countTokens();
                       numOfQuestion = tokenCount-4;
                       String rquestionNum = st.nextToken();
                       questionnAireNum = Integer.parseInt(rquestionNum);
                       String rpostCode = st.nextToken();
                       postCode = Integer.parseInt(rpostCode);
                       String rAge  = st.nextToken();
                       age = Integer.parseInt(rAge);
                       String rGender = st.nextToken();
                       gender = Integer.parseInt(rGender);
                       for(int i=0; i<numOfQuestion;i++){
                            response[i] = st.nextToken();
                       }hi how come when i cast the string as int it prompt me error as shown below ? I wonder what causes this because this is normally how i cast string to int, somehow it won work this way with token.
    Exception in thread "main" java.lang.NumberFormatException: For input string: " 3"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
         at java.lang.Integer.parseInt(Integer.java:447)
         at java.lang.Integer.valueOf(Integer.java:553)
         at test.main(test.java:43)

  • Can we write client object model code with Server object model?

    Hi everyone,
    I have to create one timer job using client object model (C#) in Sharepoint 2010 template on feature activation. Is it possible to write the code of client object in sharepoint empty project to create timer job? If yes/no? then why?
    Thanks in advance!!!

    Hi ShindeK,
    Yes you can used CSOM in Sharepoint but Timer jobs run directly on the server. The Client Side Object Model is a wrapper that brokers its calls to the server via the built in web services that SharePoint provides.
    You will not get any performance gains in this scenario using CSOM. You should use the full server object model of SharePoint
    SharePoint 2010 also has three Client Object Models (Managed, Silverlight, JavaScript) which are meant to be used by code accessing SharePoint remotely.
    --You can also used powershell script in timer job
    Chekc the link which cann help you step by step CSOM in Sharepoint timer job
    http://www.youtube.com/watch?v=Z7wHj-bSk0g
    You can also try the below link....
    https://bramdejager.wordpress.com/2013/08/02/using-csom-and-powershell-to-query-sharepoint-online-or-on-premise/
    http://stackoverflow.com/questions/3656920/run-sharepoint-timer-jobs-from-powershell
    Please mark the Answer and Vote me if you think that it will help you to resolved your issue

  • Mac Pro Can't write temporary files to 10.4 Server?

    We run a file server on an old G4 tower to a network of about 8 Macs. We are having problems with our first Intel machine. We have a 3ghz Mac pro that appears to work fine except for one problem. The server doesn't allow the Mac pro to automatically write temporary files. This is a problem since we are a design firm and we use indesign for a majority of our projects. Without this temporary file users can access the same file at the same time. This is a major problem!
    Sever is running the latest version of 10.4
    Mac pro is running the latest version of 10.4 as well
    I also ran a test where I logged in from the Mac pro to one of our G5s. Indesign functioned normal in that situation.
    Anyone have any suggestions?

    By looking at your post i have several questions to ask :
    Where are the temporary files stored ?
    Which data sharing scheme are you using for them ? AFP with POSIX or ACL behaviors, something Indesign uses ?
    Which versions of indesign are you using ? Some differences exists in between PPC installs and Universal install and may play havoc with that.
    There might as well be the question of ownership and rights that may differ as mentionned above in between your G5 workgroup and the MacPro.

  • How can I write a checkbox.label into a server text file?

    Hello, world...
    I have a problem...
    I need to write into a server text file the label of the selected checkbox..
    The client side script is:
    private function writeFile (e:MouseEvent):void
                 if (cb1.selected == true && writeBtn.label == "Conferma")
                     nc.call ("WriteNow",null,"La lettera iniziale è:"+cb1.label+"\n");
                     writeBtn.label = "Fatto";
                 else if (cb2.selected == true && writeBtn.label == "Conferma")
                      nc.call ("WriteNow",null,"La lettera iniziale è:"+cb2.label+"\n");
                     writeBtn.label = "Fatto";
                 else if (cb3.selected == true && writeBtn.label == "Conferma")
                       nc.call ("WriteNow",null,"La lettera iniziale è:"+cb3.label+"\n");
                      writeBtn.label = "Fatto";
    ...and the server side script is:
    var anVis = new File("Analisi_Visiva.txt");
    fileWriter.WriteNow = function(cliMsg)
            anVis.open("text", "append");
            if (anVis.isOpen)
                 anVis.write(cliMsg);    //line 17.
                 anVis.close( );
    I have this error in the Live Log of the FMS3 Administration Console:
    Sending error message: C:\Programmi\Adobe\Flash Media Server 3\applications\AnalisiVisiva\AnalisiVisiva.asc:line 17:File operation write failed.
    Why doesn't It work?
    Please, help me...
    Emiliano.

    Hello,
    In order to download your internal table just call the following fm:
      CALL FUNCTION 'TB_LIMIT_WS_DOWNLOAD'
       EXPORTING
      BIN_FILESIZE                  = ' '
         filename                      = dest
         filetype                      = 'ASC'
         mode                          = 'O'
       IMPORTING
         filelength                    = filesi "Bytes read
        TABLES
          data_tab                      = p_ti_temp "your IT
       EXCEPTIONS
         file_write_error              = 1
         invalid_filesize              = 2
         invalid_type                  = 3
         no_batch                      = 4
         unknown_error                 = 5
         gui_refuse_filetransfer       = 6
         no_authority                  = 7
         OTHERS                        = 8
    Hope this helps
    Gabriel

  • Can't write large files to my WebDAV server

    Hi, yesterday I set up a WebDAV directory on my mini using Apache 2.0.56 with digest authentication.
    Everything works fine when I connect from home, however, when I tried to access it from work I got some very strange reactions.
    Connection worked out-of-the-box, downloading was no problem, but uploading only worked for small files (< 200KB).
    When I tried to upload a 1MB file, it hung for quite a while, and then gave me an error code -50. When I tried again with a different file, I got an error code -43. I then tried uploading a Pages document (a typical "package") and it uploaded most of the package's contents, but returned a -43 also when transferring the images in the document.
    I found http://docs.info.apple.com/article.html?artnum=107047 but it didn't help because the suggested fix was already configured.
    Has anyone else had problems like these? Could it be a firewall, or proxy problem? If so, how might I be able to work around it?
    Thanks in advance,
    Proto

    Just chatted with a Cisco rep who offered a solution (which did not work):
    On the "Setup -> Basic Setup" tab,
    under "Internet Setup -> Optional Settings(required by some Internet Service Providers)" in the left column,
    change "MTU" from "Auto" to "Manual", and then
    change "Size" from 1500 to 1365.
    Click "Save Settings" on the bottom.
    (Mod Note: Agents Tech ID removed.)
    (Original poster's note: not a solution.)

  • Using JNI to pass an array of Strings to C and back from C

    I have some C code that I want to integrate with a new Java application and I need to be able to pass an array of strings to the C program and then the C program needs to be able to build an array of strings that is passed back to the Java program. I've got the first part working so that I can pass an array of strings to the C program and display them, but I can't figure out how to build the strings in C so that that when Java gets back control, it can display the strings tha were built in the C program.
    Has anyone done this? Do you have some sample code?

    I have a program which is written in C. I can give you the whole project as it is in a zip file. You'll need VC to work with it. By the way, I am using Windows for development. Should you need it, I'll mail you the same. Give me your mail address.

  • How to read enumerated values from an OPC server via Datasocket

    Hi Labviewers,
    I am using LV8.2 and I am trying to find if it is possible to read enumerations from an OPC server via Datasocket, not just the values.
    I can successfully read a value for an OPC server via Datasocket and I get a value for example 3, is it possible to get the enumeration/string that corresponds to this value i.e. "Open".
    Many thanks in advance
    Dimitris

    Hi Sarah,
    With the input type as variant I get the following response:
    1                                     <-This is the current numeric value of the parameter
    4 Attribute(s):
       'Quality' -> 192
       'TimeHigh' -> 29861723
       'TimeLow' -> -665408304
       'Timestamp' -> 39.238E+3
    With the Input set to         Enum constant I get no values or strings coming back. With the Input set to                Ring constant I just get the numeric value   
    Dimitris   

  • OPC server trouble seeing tags in NI Distributed System Manager

    I have created my own OPC server for simulation purposes.  If I create an I/O server and select my OPC server I can then "create bound variable" in which I can browse my OPC tags which are all in there.  I use another program which makes use of property nodes to acquire a list of paths to these tags.  The list is empty.  I noticed that when I run the "NI Distributed System Manager" I can see the I/O Server but the sub tree doesn't show my tags.  If I got them to show up in "NI DSM" then I could get a list of tag paths.  Does anyone know why my tags would show up in the "created bound variable" window and not the "NI DSM" window?  I have tried deploying the library that the I/O server is in but this doesn't work.
    Thanks
    Matt

    Thanks for the reply Charris,
    I have two OPC servers.  One is the simulator and one that I connect to at a remote location which required some OPC client software (some service in windows registry which I am not familiar with). All I know is that I can browse all tags on the remote OPC server by first creating an I/O server (yes I use OPC client) and selecting "create bound variables".  Before I bind any shared variables to OPC tags I can go into DSM and see all the tags that are not yet shared variables.
    When I try doing this with the simulator, I first create the I/O server before I can browse all the tags in "create bound variables".  But this time when I go to the DSM, they are not listed under the I/O server.  This is just an observation.
    My real problem is that I use this piece of code found on the NI website to get a list of tags (URLs).  This code works with the remote OPC server but not with the simulator.
    I don't really understand the code.  All I know is that if I input the name of the library and the name of the I/O server as well as the path to the PC, it brings back a list of URLs pointing to tags.  Maybe there is something in this VI you can help with.
    Thanks
    Matt
    Attachments:
    Get Tag List.vi ‏38 KB

  • How do I write an array of strings to a single Excel row?

    I'd like to write test data, as an array of strings, to an Excel file. Attached is my attempt to modify one of the Labview 6.1 example files. This modified example will write the data to the correct row, which is determined by serial # of the UUT, but to a new sheet for each unit. I'd like to do the same thing, but to just one sheet. This sheet's data would then be saved after 50 rows of collected test data.
    Thank you in advance,
    Tim Denson
    Attachments:
    Write Table To XL.vi ‏58 KB

    Sorry I didn't get back to faster on this. I've been out of town working and just really haven't had time.
    Yes,
    The Report Generation toolkit would make this very easy. If you have it, I'd suggest using it.
    The image shown below shows the five VIs from the toolkit that I've used to write to Excel.
    What this loop does is receive a string through a Queue, either open a
    template or open todays file, convert the tab delimited string to an
    array, write the array to the next line of the Excel file, Save (with
    todays date stamp if opened from the tempate) and close it. It's a good
    idea to always save and close teh file after each write if it's not
    being continuously written to. In this case, a new line will be written
    only once a minute or so. This lessens the chance of losing data if the
    machine locks up for some reason. Opening and closing does take time
    and can slow down a loop that needs to run at a certain rate. This loop
    actually runs in a background process and several other processes send
    data to it through the queue to be written. The queue can buffer
    several data streams if needed so you won't lose data if it's busy and
    you don't have to worry about two processes accessing the Excel sheet
    at the same time.
    Ed
    Message Edited by Ed Dickens on 02-18-2006 11:12 AM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    RGTK Array to Excel.gif ‏14 KB

  • Write Spreadsheet to String Array on another worksheet

    hi,
    is it possible to write spreadsheet to string array but to an added worksheet?
    I am currently writing results to the worksheet, but i want to create another worksheet so that i can put the raw data in.
    is it possible?
    if so, how?
    Best regards,
    Krispiekream
    Solved!
    Go to Solution.

    Sorry,
    i guess i attached the wrong picture.
    i currently have this.
    I read from a spreadsheet.
    and analysis certain row and column, then do calculation and write the results to a new spreadsheet.
    it is working fine.
    but as an option. i wanted to "read all the data from the spreadsheet as the previous image" and then write those data to the same new spreadsheet file but in a different worksheet.
    Best regards,
    Krispiekream

Maybe you are looking for