How to parse UDP byte stream ?

Hello,
 I receive binary sensor data from different sensors via UDP (Header + Data (e.g. 4 byte uint) + End). I can read the data as a string (I used the UDP Receiver.vi example), but what is an efficient way to parse the data und to view the data on an indicator ?
cheers, Tobias

joe5213 wrote:
Hi, I am new to Labview and am trying to do exactly this. Would it be possible to you to generate a simple example of "TypeCast into a properly defined cluster"? Thanks Joe
The second Type Cast is the example you are looking for.  The first one was just to make some the string in the first place.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Cluster Type Cast.png ‏8 KB

Similar Messages

  • How to parse a XML stream sent to servlet with PUT method

    Hi,
    I have to interface my servlet app with other apps communicating with XML.
    This way, My servlet will receive a XML stream in the http request, parse it and send back a XML message.
    What I've done is :
    An html page to send a XML File with a put method :
    <form enctype="multipart/form-data" method="PUT" action="http://localhost:8080/MyApp/servlet/TestUploadServlet">
         <input type="file" size="20" name="FileToUpload" value="Select File">
         <input type="submit" name="UploadFile" value="Upload">
         <input type="reset" value="Reset">
    </form>
    A servlet TestUploadServlet with :
    SAXParser parser = new SAXParser( );
    Trace.traceLine( "SAXParser" );
    parser.setContentHandler (this);
    try {
    parser.parse( new InputSource( requete.getInputStream() ) );
    catch (SAXException e) {
    Trace.traceLine( e.getMessage() );
    catch (IOException e) {
    Trace.traceLine( e.getMessage() );
    and the methods startElement, stopElement and other to work with the elements detected by the parser (already used by other programs parsing local xml files).
    And it doesn't work.
    is the html code is a good way to send a file in the http Put method ?
    is the parser.parse( new InputSource( requete.getInputStream() ) ); a good method to read the stream ?
    please help.

    I think the problemn comes from the method used to send the <XML> stream.
    Using an html form doesn't seem to be a good method.
    I tried several methods or examples found and none of them seems to work.
    here is another example in the servlet side :
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream output = res.getOutputStream();
    output.println("ContentType: " + req.getContentType() + "<BR>");
    int content_length = req.getContentLength();
    output.println("ContentLength: " + content_length + "<BR>");
    if(content_length > 0) {
    output.println("Content: ");
    ServletInputStream input = req.getInputStream();
    byte [] buffer = new byte[1024];
    int nb;
    while((nb=input.read(buffer))!= -1) {
    output.write(buffer,0,nb);
    Can somebody tell me how to write a java code sending a http request with the content of a file in the content of the request ?

  • How to parse 10 byte encoded data from Omegatte HH306 Thermometer/Datalogger?

    I am trying to write a simple code for an OMEGAETTE HH306 Thermometer/Datalogger from omega.com.
    Here is the problem. I communicate with the device via RS-232, using Labview 8.5.1 and windows xp. I query it for "all encoded data", which is basically the only option. It returns 10 bytes of encoded data, the manual describes the meaning of each byte, and I understand all of it. The problem is that I cannot seem to parse the information for use within labview, for example: I want to extract the temperature and simply display it.
    upon query, I get: 10bytes (read as a string from the serial port read buffer):     HEX display: 02 00 A8 B6 48 FF EF B6 49 03      This is perfect, and what I expect.     Codes Display: \02\00\A8\B6H\FF\EF\B6I\03               The Normal Display is a series of special characters, which I don't understand, especially since I don't think they represent the ascii characters that should correspond to the hex numbers returned!   For the life of me, I cannot figure out how to extract the information (which is the 6 48 in the hex display) from what is returned. All the string manipulation functions seem to only work on what is given in the Normal Display. (The 4th and 5th byte of the data are the BCD codes for the temperature: for example the temperature was 64.8 degrees farenheight when I took this reading).
    Can anyone help me to parse the data returned by this device?
    Solved!
    Go to Solution.

    Ok... I think I figured it out. I found this: http://digital.ni.com/public.nsf/websearch/77C8F61D36F5A23086256634005ACB38?OpenDocument.
    I guess the garbled normal display is the ascii characters corresponding to each hex number. I am just not used to seeing ascii characters beyond the decimal number 127, or hex 7F.
    So basically, to parse the 10 bytes of data:
    1) break up the string read from the serial port into the 10 individual ascii characters (using  String subset vi)
    2) wire each output string into the left input of 10 distinct Type Cast vi's.
    3) wire a U8 constant into each "type" terminal of the Type Cast vi's.
    4) wire the string output of each Type Cast vi into the input of a  number to hexadecimal string vi.
    5) concatenate or use as you would like the hex numbers (now in string format) that result.
    Cheers.

  • How to convert character streams to byte streams?

    Hi,
    I know InputStreamReader can convert byte streams to character streams? But how to convert the character streams back to byte streams? Is there a Java class for that?
    Thanks in advance.

    When do you have to do this? There's probably another way. If you just start out using only InputStreams you shouldn't have that problem.

  • How do you separate UDP data streams

    Hi.  I'm currently using LabVIEW 2013  to read in a UDP data stream (packet) that contains various parameters.  I am successful in receiving the UDP packet using the UDP Open and UDP Read vi.  On the data out of the UDP Read I have it running into the "Unflatten to String" function and the type I have created a cluster containing 32-bit floating point (Single Precision in LabVIEW) numeric constant, since that is the type of data I am receiving.  To be able to separate the different parameters coming in, I have created the same number of numeric constants blocks to equal the number of parameters.  Is there an easier way to separate the data from the UDP data out so that I don't have to create so many numeric constants to represent the same number of data I have coming in?  Sometimes we will way more than what is listed below.
    Any help will be appreciated.  Thank you in advanced
    Attachments:
    Example layout (Not actual).vi ‏11 KB

    If all the data is the same type, then you can wire an array as the datatype instead of a cluster. Set the "data includes array or string size" input to False (the default is True). The output will be an array, and you can index out the values you want.

  • How to define "byte stream type" for "open file"?

    Hello,
    I created some numbers (type "double") in Matlab and stored in a file. What value should I use to specify the "byte stream type" for "open file" in Labview? Should I put something like "DBL" or "I32". I don't know where to find the list of legal "types" in Labiew help.
    Thanks so much!
    Felicia

    Looks like 7.1:
    The Matlab "double" is 64 bits (8 bytes). It doesn't make much sense to use an integer datatype to read a floating point value, so you would use DBL in LabVIEW. The numeric data types table can be found here.
    By the way, this assumes you saved the file as raw binary, as opposed to a .mat file, which is something different.
    Message Edited by smercurio_fc on 08-08-2008 11:21 AM
    Attachments:
    read file 7.png ‏13 KB

  • How to parse a record (from record store) to String?

    Hi,
    I have a record store which stores movie titles specified by users (from multiple-selection list). I tried to access the records using nextRecord() from RecordEnumeration. This would return a byte array.
    How shall I parse the byte array to a String? I tried ByteArrayInputStream toString() method; I tried creating a new String with the byte as parameter. But it simply does not produce the original String. Sometimes it gives me something like a hex. string. Can anyone point out what has gone wrong?
    Thanks.

    lily2007 wrote:
    toString() returns this: "java.io.ByteArrayInputStream@1cb37664"
    What does it mean?That means that toString() is not overridden and does not return the content of the stream as a bytearray (ByteArrayOutputStream however does do this).
    I tried the new String(byte) method and got back the original String but with some whitespace in front.Let me guess: you write the string using writeUTF()?

  • How to parse XML against XSD,DTD, etc.. locally (no internet connection) ?

    i've searched on how to parse xml against xsd,dtd,etc.. without the needs of internet connection..
    but unfortunately, only the xsd file can be set locally and still there needs the internet connection for the other features, properties.
    XML: GML file input from gui
    XSD: input from gui
    javax.xml
    package demo;
    import java.io.File;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.xml.XMLConstants;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.SAXException;
    public class Sample1WithJavaxXML {
         public static void main(String[] args) {
              URL schemaFile = null;
              try {
                   //schemaFile = new URL("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd");
                   File file0 = new File("AppSchema-C01-v1_0.xsd");
                   schemaFile = new URL(file0.toURI().toString());
              } catch (MalformedURLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              //Source xmlFile = new StreamSource(new File("web.xml"));
              Source xmlFile = new StreamSource(new File("C01.xml"));
              SchemaFactory schemaFactory = SchemaFactory
                  .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              //File file1 = new File("XMLSchema.dtd");
              //SchemaFactory schemaFactory = SchemaFactory
                   //.newInstance("javax.xml.validation.SchemaFactory:XMLSchema.dtd");
              Schema schema = null;
              try {
                   schema = schemaFactory.newSchema(schemaFile);
              } catch (SAXException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              Validator validator = schema.newValidator();
              try {
                validator.validate(xmlFile);
                System.out.println(xmlFile.getSystemId() + " is valid");
              } catch (SAXException e) {
                System.out.println(xmlFile.getSystemId() + " is NOT valid");
                System.out.println("Reason: " + e.getLocalizedMessage());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Xerces
    package demo;
    import java.io.File;
    import java.util.Date;
    import org.apache.xerces.parsers.DOMParser;
    public class SchemaTest {
         private String xmlFile = "";
         private String xsdFile = "";
         public SchemaTest(String xmlFile, String xsdFile) {
              this.xmlFile = xmlFile;
              this.xsdFile = xsdFile;
         public static void main (String args[]) {
              File file0 = new File("AppSchema-C01-v1_0.xsd");
              String xsd = file0.toURI().toString();
              SchemaTest testXml = new SchemaTest("C01.xml",xsd);
              testXml.process();
         public void process() {
              File docFile = new File(xmlFile);
              DOMParser parser = new DOMParser();
              try {
                   parser.setFeature("http://xml.org/sax/features/validation", true);
                   parser.setFeature("http://apache.org/xml/features/validation/schema", true);
                   parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                             xsdFile);
                   ErrorChecker errors = new ErrorChecker();
                   parser.setErrorHandler(errors);
                   System.out.println(new Date().toString() + " START");
                   parser.parse(docFile.toString());
              } catch (Exception e) {
                   System.out.print("Problem parsing the file.");
                   System.out.println("Error: " + e);
                   System.out.println(new Date().toString() + " ERROR");
                   return;
              System.out.println(new Date().toString() + " END");
    }

    Thanks a lot Sir DrClap..
    I tried to use and implement the org.w3c.dom.ls.LSResourceResolver Interface which is based on the SAX2 EntityResolver.
    please give comments the way I implement it. Here's the code:
    LSResourceResolver Implementation
    import org.w3c.dom.ls.LSInput;
    import org.w3c.dom.ls.LSResourceResolver;
    import abc.xml.XsdConstant.Path.DTD;
    import abc.xml.XsdConstant.Path.XSD;
    public class LSResourceResolverImpl implements LSResourceResolver {
         public LSResourceResolverImpl() {
          * {@inheritDoc}
         @Override
         public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
              ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              LSInput input = new LSInputImpl(publicId, systemId, baseURI);
              if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
                   input.setByteStream(classLoader.getResourceAsStream(XSD.XML));
              } else if (XsdConstant.PUBLIC_ID_XMLSCHEMA.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.XML_SCHEMA));
              } else if (XsdConstant.PUBLIC_ID_DATATYPES.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.DATATYPES));
              return input;
    }I also implement org.w3c.dom.ls.LSInput
    import java.io.InputStream;
    import java.io.Reader;
    import org.w3c.dom.ls.LSInput;
    public class LSInputImpl implements LSInput {
         private String publicId;
         private String systemId;
         private String baseURI;
         private InputStream byteStream;
         private String stringData;
         public LSInputImpl(String publicId, String systemId, String baseURI) {
              super();
              this.publicId = publicId;
              this.systemId = systemId;
              this.baseURI = baseURI;
         //getters & setters
    }Then, here's the usage/application:
    I create XMLChecker class (SchemaFactory implementation is Xerces)
    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.XMLConstants;
    import javax.xml.stream.FactoryConfigurationError;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import abc.xml.XsdConstant.Path.XSD;
    public class XMLChecker {
         private ErrorMessage errorMessage = new ErrorMessage();
         public boolean validate(String filePath){
              final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              List<Source> schemas = new ArrayList<Source>();
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XML_SCHEMA)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XLINKS)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream("abc/xml/AppSchema.xsd")));
              SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              schemaFactory.setResourceResolver(new LSResourceResolverImpl());
              try {
                   Schema schema = schemaFactory.newSchema(schemas.toArray(new Source[schemas.size()]));
                   Validator validator = schema.newValidator();
                   validator.setErrorHandler(new ErrorHandler() {
                        @Override
                        public void error(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void fatalError(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void warning(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                   StreamSource source = new StreamSource(new File(filePath));
                   validator.validate(source);
              } catch (SAXParseException e) {
                   return false;
              } catch (SAXException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (FactoryConfigurationError e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (IOException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              return true;
         public ErrorMessage getErrorMessage() {
              return errorMessage;
    }Edited by: erossy on Aug 31, 2010 1:56 AM

  • How to parse xml file, containing image,  generaged from JAX-RS connector?

    Hi,
    We are using JAX-RS connector and just want to call getBusinessObjects() directly using JerseyMe (basically bypassing sync engine). We have used sync engine so far and want to try as how to bypass it. The method produces the text/xml and verified the xml file in the web by giving the full url. The plan is to call the same URL from the Java Me Client using JerseyMe. When I print the bytes at the client I receive the same xml that I have seen in the web. Actually, I am passing an image that I can see in a different character format in xml (assuming this is bcos of UTF-8 encoding). I am wondering as how to parse this xml file and how to decode the "UTF-8" format? Do we need to use SGMP for this or use kxml or java me webservices spec.
    I would really appreciate if somebody can answer this one.
    I have been observing in this forum that SGMP team is not at all active in answering the questions. Please let us know whether Oracle is keeping this product and we can continue using SGMP1.1. Please let us know so that we can plan accordingly as we are building a product based on SGMP.

    Hi Rajiv,
    The client library is using org.apache.commons.codec.binary.Base64 internally. We don't have the full Commons Codec library bundled, but you can look up the javadoc for the Base64 class online. All you need to do is call Base64.decode(obj.getBytes()) on the objects you get out of the XML.
    In general it isn't a good idea to depend on implementation details of the client library, but in this case, I think it is pretty safe to expect org.apache.commons.codec.binary.Base64 to remain in our library.
    --Ryan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to parse xml string

    Hi! I'm having problems parsing an xml string. I've done DOM and SAX parsing before. But both of them either parse a file or data from an input source. I don't think they handle strings. I also don't want to write the string into a file just so I can use DOM or SAX.
    I'm looking for something where I could simply do:
    Document doc = documentBuilder.parse( myXMLString );
    So the heirarchy is automatically established for me. Then I could just do
    Element elem = doc.getElement();
    String name = elem.getTagName();
    These aren't the only methods I would want to use. Again, my main problem is how to parse xml if it is stored in a string, not a file, nor comming from a stream.
    thanks!

    But both of them either parse a file or data from an input source. I don't think they handle strings.An InputSource can be constructed with a Reader as input. One useful subclass of Reader is StringReader, so you'd use something likeDocument doc = documentBuilder.parse(new InputSource(new StringReader(myXMLString)));

  • Help with Sample on Converting an XML string to a byte stream

    Hello All,<br /><br />I am sure this is something simple, but I am just not figuring it out right now.<br /><br />I am following the sample - "Converting an XML string to a byte stream" from the developer guide since I want to prepopulate just 1 field in my PDF form.<br /><br />How do I reference my form field within my servlet code properly??<br /><br />I have tried a few things now, my field is within a subform, so I thought it would be <root><subformName><fieldname>My data</fieldname></subformName></root>  I have also tried adding <page1> in there too.<br /><br />I am following everything else exactly as given in the sample code.<br /><br />I do have an embedded schema within the form and the field is bound.<br /><br />Thanks,<br />Jennifer

    Well, if you have a schema defined in the form, then the hierarchy of your data must match what is described in the schema. So, can't really tell you what it would look like, but just follow your schema.
    Chris
    Adobe Enterprise Developer Support

  • Data plug-in for binary data with byte streams of variable length

    Hi there,
    I would like to write a data plug-in to read binary data from file and I'm using DIAdem 10.1.
    Each data set in my file consists of binary data with a fixed structure (readable by using direct access channels) and of a byte stream of variable length. The variable length of each byte stream is coded in the fixed data part.
    Can anyone tell me how my data plug-in must look like to read such kind of data files?
    Many thanks in advance!
    Kind regards,
    Stefan

    Hi Brad,
    thank you for the very quick response!
    I forgot to mention, that the data in the byte stream can actually be ignored, it is no data to be evaluated in DIAdem (it is picture data and the picture size varies from data set to data set).
    So basically, of each data set I would like to read the fixed-structure data (which is the first part of the data set) and discard the variable byte stream (last part of the data set).
    Here is a logical (example) layout of my binary data file:
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXX (byte stream)
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXX (byte stream)
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXXXXXXXXX (byte stream)
    What I would like to show in DIAdem is only fixedSize-Value1 and fixedSize-Value2.
    ´
    If I understood right, would it be possible to set the BlockLength of each data set by assigning Block.BlockLength = fixedSize-Value3 and to use Direct Access Channels for reading fixedSize-Value1 and fixedSize-Value2 ?
    Thank you!
    Kind regards,
    Stefan

  • How to parse Dir Command Output ?

    Hi All,
    When I execute the Dir /tc i'll get the output :-
    Volume in drive D has no label.
    Volume Serial Number is E878-37E9
    Directory of D:\rohit
    02/15/2006 10:06 AM <DIR> .
    02/15/2006 10:06 AM <DIR> ..
    03/13/2006 11:03 AM 2,349 appe_attr_sheet.xls
    03/13/2006 10:38 AM 2,149 appe_goal_sheet.xls
    02/15/2006 10:09 AM 32,768 CV.doc
    3File(s) 296,513 bytes
    2 Dir(s) 16,253,956,096 bytes free
    But i want only files details. How to parse the above String to this :-
    03/13/2006 11:03 AM 2,349 appe_attr_sheet.xls
    03/13/2006 10:38 AM 2,149 appe_goal_sheet.xls
    02/15/2006 10:09 AM 32,768 CV.doc
    Thanks.

    HI All,
    I am confused .. here what i have written:-
    public class TestStringConversion
         public TestStringConversion()
              Process objPerm = null;
              BufferedReader input = null;
              String[] sTokens;
              String command = "cmd /c dir /tc";
              try {
                   objPerm = Runtime.getRuntime().exec(command);
                   input =
                        new BufferedReader(
                             new InputStreamReader(
                                  objPerm.getInputStream()));
                   StringBuffer output = new StringBuffer();
                   String lineOutput = null;
                   int lineNo = 0;
                   while ((lineOutput = input.readLine()) != null ) {
                        if(lineOutput.indexOf("<DIR>")>0 && lineOutput.indexOf("File(s)")==-1 && lineOutput.indexOf("Dir(s)")==-1)
                             continue;
                        lineNo++;
                        if (lineNo > 5) {
                             //&& lineOutput.indexOf("<DIR>")==-1 && lineOutput.indexOf("File(s)")==-1 && lineOutput.indexOf("Dir(s)")==-1
                             output.append(lineOutput + "\n");
                   Pattern pat =Pattern.compile("^((0?[1-9])|(1\\d)|(2\\d)|(3[0-1]))\\/");
                   Matcher mat;
                   mat = pat.matcher(output);
                   if (mat.find()){
                             System.out.println(output);
                   }else{
              } catch (Exception e) {
         public static void main(String args[])
              new TestStringConversion();
    Plz let me know what i have to do , to get only Files from a directory and put it into treemap.
    Thanks.

  • Specifying byte stream type for Read File with Type Descriptor

    Hi.
    I'm trying to write a VI that reads an image file format that can have
    different datatypes. What I have so far is that I open the file, read
    the header, and get the width, height, number of frames, and datatype.
    I calculate number of pixels by nrows*ncols*nframes with no problem,
    but I'm not sure how to tell Read File the correct datatype to read
    the data into.
    I tried using a Case structure where I have a Read File in each case
    with the correct type constant as input for that case. The problem is
    that the tunnel graduates the datatype to the highest representation.
    I found in Application Note 154 the discussion about Type Descriptors.
    Is there a way to generate a Type Descriptor and output it from a C
    ase
    structure? I tried just returning the value (e.g. 0x0402 for a Word),
    but Read File will just see that the byte stream type is a uint32.
    Is there any other way to do this?
    Thanks for any help.

    I converted the code to LabVIEW 6.1 for you and attached it below.
    Don't worry about being a newbie. We all start there. Keep asking this type of question and you won't stay there long.
    As you are discovering, being strictly typed means that you must rewrite code even for a simple data type change, or convert everything to the same data type first. For image data, conversion can result in a lot of extra space being wasted. Use a modified version of the GLV_WaveformBuffer.vi to hold your data. Use the array functions, which operate inline, to add to and delete the data wires in the buffer. This allows you to save several different data types. You will need several different inputs and outputs to handle these data types. I ha
    ve also attached a similar file created for exactly the problem you have - storing arrays of different data types (data from NI-SCOPE devices, in this case - can be float, I8, I16, or I32).
    Routines that take any type work in one of two ways. LabVIEW primitives, such as plus and minus operators, work by figuring out the type and doing the right thing in the C code layer of the LabVIEW environment. Users of LabVIEW can't do this. Users can make polymorphic VIs. Polymorphic VIs are actually a single VI for every data type that are referenced by a "wrapper", the polymorphic VI. Users still need to write a different VI for every data type they need.
    Take home message - if you need to work with different data types, you will need to rewrite your code for every data type or convert your data to a common data type. Polymorphic VIs and case statements are your friend.
    Let me know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    GigaLabVIEW61.zip ‏362 KB
    sfpScpChan_Waveform_Buffer.zip ‏74 KB

  • Sending byte streams with a String

    Hi all,
    I want to control a GPIB-Camac Interface with java. Therefore I have to send the GPIB-Commands via a method sendCommand(String). The problem is that my GPIB device expects byte streams rather than a String. Now I don't know how exactly bytes are handled by a String. If I construct a String like this
    String StartGateA = new String(new byte[] { 25, 0, 1 });
    I think the bytes are converted to Unicode, e.g. to 16 bit values. There's the problem. I need to have a String representing the { 25, 0, 1 } byte array as real bytes, i.e. a String containing of 3 bytes holding the specified numbers.
    Are there any suggestions?
    Thx in advance, Mathias

    see ur concern i suppose is that u want to send
    for eg 3 bytes ie 25 3 1 in the form of String to the device,
    and that once u send it the device should recieve in proper format,
    Am i right?
    if yes then is there a way through which u can check if the array that u r sending is recieved properly?
    If you constrcut a String with String s = new String(new byte[] { 25, 0, 1 }); and try to retrieve the bytes you will get them in the same order, so if u r sending it then it should similarly,
    only if u can check whether the string that u r sending is recieved properly, if not then what is the string that is recieved
    Regards
    Rohan

Maybe you are looking for

  • Specifying coherence-cache-config.xml for multiple clusters

    Hi, I am running two cache clusters (Cluster A and B that hold different cache types). we have a web application that needs to communicate with both the clusters. we have two coherence-cache-config-g.xml files, one for each cluster. where do we speci

  • Can't get past blue screen on Windows partition

    I have been using bootcamp for a little over a month now. It had been working great. But suddenly today, Windows will not boot up- It stays on a blue screen, and gives me options to restart (which does nothing) and Advanced Options (which none of the

  • Images are not clear in pdf output

    Hi, Images are blurred once a pdf file is generated. Don't understand why. Please let me know a solution to get pictures with better clarity after generating a pdf . I used to shrink the images a bit to set them in the Framemaker area. Once the pdf i

  • My IP4 on/off switch has stopped functioning.

    My On/Off switch has stopped functioning. No depression, no click and no response. Has anyone else had this problem and if so, did you solve it? How?

  • Setting ISO-8859-1 Encoding in AXIS RPC call

    As per my understanding UTF-8 is default for webservice call in AXIS implementation I may be wrong. Is there any way to set ISO-8859-1 encoding in AXIS RPC call? Below is the WSDL file details. Thanks for you help. Regards, Hemen <Code> <?xml version