Read Binary String using BSP

Hi All,
How can i read a document that is stored in SQL server as BLOB. (Binary Large Object) using BSP. I want to store the file into an internal table and post it to a transaction.
Thanks,
Naga

hi,
refer to this link:
http://help.sap.com/saphelp_nw04/helpdata/en/f1/b4a6c4df3911d18e080000e8a48612/frameset.htm
thanks
jaideep
<i>
<i>if <useful>
reward </i></i>

Similar Messages

  • Disable default read community string

    I would like to know the procedure to disable the default read community string which is "public" and change create a new read community string using SMC 3.0

    In your topology view, right click on a host, select "Attribute Editor". Then click the "Security" tab. There are sections here to control the user and group access control as well as the SNMP community string settings for the agent. You can make changes to the community string and hit "OK".
    Regards,
    Jeff Grabell
    www.cirba.com

  • How can I convert a U32 array into binary string?

    Hi
    I would like to find an efficient way to convert an array of 8192 U32 into a single binary string!!!
    the solution below  last 550 ms on an RT target to convert 8192 U32.
    The same code running on Labview (not RT) last 100ms. I don't understand why there is such a difference.
    I've tryed to replace the inner loop and convert by a format string whith U32 on entry and %032b as parameter but it lasted same time.
    Thanks a lot

    Your picture of your code didn't come through. You can't link to a picture that's on your computer, as a server on the internet cannot access your computer to display the picture for others to see. You have to upload the picture as an attachment. Then, if you want to actually display the picture in the message you have to edit your post, insert a picture, and when it asks for the URL you enter the URL of the picture. You can get the URL when viewing the message, as the link is within the message itself.
    As for your question, can you just use the TypeCast function?

  • Conversion of Decimal to Binary String

    Hello Labview People:
    I'm rather new to Labview, so this may be a simple-minded question . . .
    I would like to take a numeric control and have the decimal input
    converted to a binary string of 8 bits. So, for example, if I were to
    put in the number '127', I would get out (on an indicator) the string:
    01111111
    The number '128' would show on the indicator as:
    10000000
    It seems to me that this should be simple, but somehow I cannot figure
    out how to do it. Must an array be built bit by bit to accomplish this?
    (I'm afraid I don't yet know how to build arrays.)
    Thanks in advance for any help you provide!
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Or, you can go under the numeric function, and look for conversions, get
    decimal to byte array conversion.
    Then what you need to do is to get an array selection vi, and index to zero.
    I don't remember the exact name of the VI's because I don't have LabView
    here with me.
    Perhaps this complicates things
    Steven
    "Timo Miettunen" wrote in message
    news:[email protected]..
    > use format into string VI from string palette
    >
    > format string should be "%08b" for 8 bits, "%016b" for 16 bits etc.
    >
    > timo
    >
    > Ananda Dave wrote:
    > >
    > > Hello Labview People:
    > >
    > > I'm rather new to Labview, so this may be a simple-minded question . . .
    > >
    > > I would like to take a numeric control and have the decimal input
    > >
    converted to a binary string of 8 bits. So, for example, if I were to
    > > put in the number '127', I would get out (on an indicator) the string:
    > >
    > > 01111111
    > >
    > > The number '128' would show on the indicator as:
    > >
    > > 10000000
    > >
    > > It seems to me that this should be simple, but somehow I cannot figure
    > > out how to do it. Must an array be built bit by bit to accomplish this?
    > > (I'm afraid I don't yet know how to build arrays.)
    > >
    > > Thanks in advance for any help you provide!
    > >
    > > Sent via Deja.com http://www.deja.com/
    > > Before you buy.
    >
    > --
    > -------------------------------------------------
    > Timo Miettunen
    >
    > Fincitec Oy Production Department
    > e-mail: [email protected]
    > Address:
    > Lumikontie 2 Tel: +358-16-2151245
    > PO BOX 11 Fax: +358-16-221561
    > FIN-94600 KEMI Finland
    > -------------------------------------------------

  • Encoding problem while reading binary data from MQ-series

    Dear all,
    we are running on 7.0 and we have an encoding problem while reading binary data from MQ-series. Because we are getting flat strings from queue we use module "Plain2ML" (MessageTransformBean) for wrapping xml-elements around the incoming data.
    The MQ-Series-Server is using CCSID 850, which we configured in connection parameters in communication channel (both parameters for Queuemanager CCSID and also CCSID of target).If there are special characters in the message (which HEX-values differ from codepage to codepage) we get errors in our adapter while executing, please see stack-trace for further analysis below.
    It seems to us that
    1. method ByteToCharUTF8.convert() expects UTF-8 in binary data
    2. Both CCSID parameters are not used anyway in JMS-adapter
    How can we solve this problem without changing anything on MQ-site?
    Here is the stack-trace:
    Catching com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.af.modules.trans.MessageTransformBean.throwModuleException(MessageTransformBean.java:453)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:387)
        at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:292)
        at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.adapter.jms.core.channel.filter.SendToModuleProcessorFilter.filter(SendToModuleProcessorFilter.java:84)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertBinaryToXiMessageFilter.filter(ConvertBinaryToXiMessageFilter.java:304)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:112)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:87)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filterSend(TxManagerFilter.java:123)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filter(TxManagerFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.DynamicConfigurationFilter.filter(DynamicConfigurationFilter.java:72)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.PmiAgentFilter.filter(PmiAgentFilter.java:66)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundCorrelationFilter.filter(InboundCorrelationFilter.java:60)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JmsHeadersProfileFilter.filter(JmsHeadersProfileFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageInvocationsFilter.filter(MessageInvocationsFilter.java:89)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JarmMonitorFilter.filter(JarmMonitorFilter.java:57)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ThreadNamingFilter.filter(ThreadNamingFilter.java:62)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.SenderChannelImpl.doReceive(SenderChannelImpl.java:263)
        at com.sap.aii.adapter.jms.core.channel.ChannelImpl.receive(ChannelImpl.java:437)
        at com.sap.aii.adapter.jms.core.connector.MessageListenerImpl.onMessage(MessageListenerImpl.java:36)
        at com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(MQMessageConsumer.java:399)
        at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:904)
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4249)
        at com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:537)
        at java.lang.Thread.run(Thread.java:770)
    Caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:714)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:538)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:528)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:471)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:364)
        ... 36 more
    Caused by: sun.io.MalformedInputException
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:270)
        at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
        at java.io.InputStreamReader.read(InputStreamReader.java:208)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.LineNumberReader.readLine(LineNumberReader.java:176)
        at com.sap.aii.messaging.adapter.Conversion.convertPlain2XML(Conversion.java:310)
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:709)
        ... 40 more
    Any ideas?
    Kind regards, Stefan

    Hi Stefan,
    for the first MTB now we are using only one parameter: Transform.ContentType = text/plain;charset="ISO-8859-1"
    The second MTB, which does the XML-Wrapping, is configured like this:
    Transform.Class = com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType = application/xml
    xml.conversionType = SimplePlain2XML
    xml.fieldNames = value
    xml.fieldSeparator = §%zulu§%
    xml.processFieldNames = fromConfiguration
    xml.structureTitle = payload
    Both CCSID configuration parameters from the "Source"-Tab we've set to 850.
    Now, we don't get an error anymore - sun.io.malformedInputException - , but, unfortunately, now special character conversion succeeded (we need an "ß" and we get an ISO-HEX-E1 -> á).  E1 is (different from ISO) an "ß" in 850.
    Any ideas?

  • Converting a binary string into a JPEG image in Crystal Reports 2008

    Hi Gang
    Iu2019m having problems converting a binary string into an image in Crystal Reports 2008
    I have JPEG images stored in ECC.  ECC stores the data in binary format.
    Iu2019m using the ECC function module SKWF_PHIO_CONTENT_ACCESS_GET to retrieve the data.  This function module has an export table, FILE_CONTENT_BINARY, which returns several lines of data.  Each line contains a maximum of 1,024 characters.
    When I drop the T_ FILE_CONTENT_BINARY.LINE field into my Crystal Report detail section, I wind up with a report that displays all the lines in FILE_CONTENT_BINARY table.  (in my case, 19 lines are displayed.)
    I created a formula to collect all the data into a single string.
    whileprintingrecords;
    stringvar data:= data & {SKWF_PHIO_CONTENT_ACCESS_GET.T_FILE_CONTENT_BINARY.LINE}
    I added the formula to the detail section and itu2019s doing a great job collecting the data.
    I then inserted a picture object in the report footer, opened the format editor, navigated to the u201Cpictureu201D tab, and inserted a formula for the u201Cgraphics locationu201D.
    whileprintingrecords;
    stringvar data:=data;
    data
    My clever idea turned out to be a disappointment . . . . my picture object is blank.
    Does anyone have a solution for converting a binary string into a JPEG image?

    Save the JPEG in a format CR supports. Refer to the help file for the file types.

  • Binary String to numerical binary array

    Hello,
    I initially created binary strings from numerical numbers using the
    "%03b" command on the 'Format into String' block. I then concatenated
    the various strings into one string that is now composed of 16bits.
    However, I need to convert this string that I created back to a binary
    numerical array for further processing.
    Can you help me with this?
    Thanks,
    Rajesh.

    triniboy wrote:
    I initially created binary strings from numerical numbers using the
    "%03b" command on the 'Format into String' block. I then concatenated
    the various strings into one string that is now composed of 16bits.
    In general, you are out of luck, because the number of characters for each value when formatted to binary with "%03b", will be variable. Any number greater than 7 will use more than 3 digits. (since you use "03" instead of 3", smaller numbers will have three digits with possible leading zeroes for padding).
    After you concatenated all the formatted strings, you loose all boundary information unless ALL numbers are less than 8, but in this case they result would be a multiple of 3 and would not add up to 16 bits, right?
    My best suggestion would be to NOT create a binary formatted string in this way, because it is a one-way operation and cannot be undone because you loose information in the process.
    Back to square one!
    Maybe we can backup a few steps and you can explain to us what you really want to do with your original numbers. Why would you even consider formatting them this way? Do you need to save them to a file for later retrieval, for example?
    LabVIEW Champion . Do more with less code and in less time .

  • Read binary file 10 bytes at a time

    I want to read binary file in a specific format. There is a number at the starting of the file. That tells us where the data is starting. Suppose it says 3975, then it mean data starts at 3975. Then once I read that location I want to read data at 10bytes at a time and then convert it to numeric and display it on graph. I am attaching the file format and the current vi which I am using. please help.
    Solved!
    Go to Solution.
    Attachments:
    topo.zip ‏89 KB

    Ah, the first 10 characters are a string!
    After opening the file, use the Read From Text File with count set to 10.  Then use the Decimal String to Number to convert this string into your "record size".
    NOTE:  The text indicator was just for debug purposes.  You don't really need it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Read record size.png ‏12 KB

  • Decoding binary strings from 10 bit A/D converter

    Hi all,
    I'm working on a project for school that requires me to take data from an A/D converter ( the A/D is on a Motorola HCS12 microcontroller) and send it to a PC running LABVIEW to decode the binary string into a numerical value.  The value will be plugged into an equation.  I planned on using the serial port on the PC for the comm port.  Are there any examples available or any advice to get me started in the right direction. 
    While I have programmed with LABVIEW in the past (academically) I am not proficient.  And this type of interfacing I have not done before, only GPIB.
    The A/D is 10 bit.  How quick LABVIEW decodes the binary string and returns a value is not important. 
    If any more info. is needed let me know.    

    Be confident. That should not be a big problem, since you'll get the help of the LV community
    The most difficult part will be to establish the communication with your micro-controler. But if you can do that with Windows hyperterminal, then you are nearly done ! There are examples of serial com in the examples shipped with LV.
    The string to decimal conversion will not be a problem, whatever the string format : the conversion is done using functions also shipped with LV.
    Hope to see you soon with more specific questions.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Evaluating binary strings with "Don't care" conditions

    I frequently have to evaluate binary strings or register values for particular bits. Does anyone have a better way? And if not, perhaps this is a suggestion for NI.
    To this point I've used two methods:
    1. I turn the data into an actual string in my CVI code and inject X's in the necessary positions. I then perform a string evaluation for equivalence, the string now consisting of '1's '0's and 'x's.
    2. Bring the data into the teststep and applying an expression to the data source, masking the appropriate bits. Then evaluate as a numeric with a value that assumes the offended bits "zeroness" or "oneness" depending on how I've implemented.
    The first was one requires specialized code, but allows for a little more visibility (in the code at least) of which bits are designated as DCs. But translating a multiple byte and variable length of amount of information into a string is cumbersome. Sure the code is reusable, but I'm not convinced the translation is necessary or best.
    The second buries the mask in a window that is, seemingly, infrequently used. I've had colleagues work on a project behind me trying to figure out where the value was being manipulated because I've applied a mask via the source. My original explanation of "ninjas" wasn't well taken...
    It seems like it would be ideal for the limits window to allow the use of "X"s when defining a "binary" type comparison so that the mask is clearly defined in the limit itself, and the data as it's passed to and from teststand remains untouched. Also, if this were to be implemented I would hope the property loader would support it.
    Am I missing a much easier way to do this? Anyone have a better way?
    Thanks in advance!
    Colt.
    P.S. Why isn't "NI" and "CVI" built into the spell checker?

    So in that first case where I am using CVI to "insert" I am building a string type vector that contains ASCII '1's '0's and 'x's. Where the Xs are in the binary position for what I am considering as "don't care".
    So say for instance I was converting a piece of data that was 0xEB, with bit 0 being considered a DC for evaluation, I would build a string like "1110 101X" . This string is what I would pass back to teststand. In teststand I would then perform an equivalence test between the two strings.
    For the second question about an implementation for the limit, say I open the test step, click on "Edit Limits" then from the drop down in the bottom right I select "Binary". I could then compose a limit in a similar form as described above. Where the limit box could contain something like "0b1110101X". But as for the data I hand to teststand, it would still be just a scalar value, with no masks applied. In the code, or in teststand.
    Sorry if I'm not making any sense! I hardly ever do...
    Colt.

  • Reading SNMP packet using PL/SQL and XML

    Hi,
    Is it possible to read the content of a SNMP packet using MIB file converted into XML. I know it's possible to develop a java program which can collect SNMP packets from the network and inserts them into Oracle. The problem after that is how to read the content using MIB library file. It's possible to convert the MIB file into XML file but the problem is to create s PL/SQL block which can read the XML file and based on the content to translate the information from the SNMP packet. Is it possible?
    regards
    Edited by: user10484841 on Sep 24, 2010 3:15 AM

    Thank you for the reply!
    I have converted oracle MIB into xml using prtg's import tool. As far as I see prtg also uses xml as you can see below.
    So how I can translate string for example 1.3.6.1.2.1.39.1.1.1.1.1111111111 using xml and pl/sql?
    Can you give me direction where to start?
    <?xml version="1.0" encoding="ISO8859-1" ?>
    <oidlist>
    <system>
    <version>
    1
    </version>
    </system>
    <list>
    <entry>
    <name>
    RDBMS-MIB|rdbms db: #[1.3.6.1.2.1.39.1.1.1.1]|rdbms db index
    </name>
    <oid>
    1.3.6.1.2.1.39.1.1.1.1
    </oid>
    <type>
    vmAbsolute
    </type>
    <kind>
    mkTable
    </kind>
    <unittype>
    sutCustom
    </unittype>
    <units>
    </units>
    <indicator>
    rdbms db index
    </indicator>
    <scale>
    1
    </scale>
    <multiply>
    no
    </multiply>
    <max>
    0
    </max>
    <usegetnext>
    no
    </usegetnext>
    <is64bit>
    no
    </is64bit>
    <isunsigned>
    no
    </isunsigned>
    <isfloat>
    no
    </isfloat>
    <description>
    A numeric index, unique among all the databases from all products on this host. This value is a surrogate for the conceptually unique key, which is {PrivateMibOID, databasename}
    </description>
    </entry>
    <entry>
    <name>
    RDBMS-MIB|rdbms db info: #[1.3.6.1.2.1.39.1.1.1.3]|rdbms db info size units
    </name>
    <oid>
    1.3.6.1.2.1.39.1.2.1.3
    </oid>
    <type>
    vmAbsolute
    </type>
    <kind>
    mkTable
    </kind>
    <unittype>
    sutCustom
    </unittype>
    <units>
    </units>
    <indicator>
    rdbms db info size units
    </indicator>
    <scale>
    1
    </scale>
    <multiply>
    no
    </multiply>
    <max>
    0
    </max>
    <usegetnext>
    no
    </usegetnext>
    <is64bit>
    no
    </is64bit>
    <isunsigned>
    no
    </isunsigned>
    <isfloat>
    no
    </isfloat>
    <description>
    Identification of the units used to measure the size of this database in rdbmsDbInfoSizeAllocated and rdbmsDbInfoSizeUsed. bytes(1) indicates ndividual bytes, kbytes(2) indicates units of kilobytes, mbytes(3) indicates units of megabytes, gbytes(4) indicates units of gigabytes, and tbytes(5) indicates units of terabytes. All are binary multiples -- 1K = 1024. If writable, changes here are reflected in the get values of the associated objects.
    </description>
    </entry>
    <entry>
    <name>
    RDBMS-MIB|rdbms db info: #[1.3.6.1.2.1.39.1.1.1.3]| rdbms db info size allocated
    </name>
    <oid>
    1.3.6.1.2.1.39.1.2.1.4
    </oid>
    <type>
    vmAbsolute
    </type>
    <kind>
    mkTable
    </kind>
    <unittype>
    sutCustom
    </unittype>
    <units>
    </units>
    <indicator>
    rdbms db info size allocated
    </indicator>
    <scale>
    1
    </scale>
    <multiply>
    no
    </multiply>
    <max>
    0
    </max>
    <usegetnext>
    no
    </usegetnext>
    <is64bit>
    no
    </is64bit>
    <isunsigned>
    no
    </isunsigned>
    <isfloat>
    no
    </isfloat>
    <description>
    The estimated size of this database (in rdbmsDbInfoSizeUnits), which is the disk space that has been allocated to it and is no longer available to sers on this host. rdbmsDbInfoSize does not necessarily indicate the amount of space actually in use for database data. Some databases may support extending allocated size, and others may not. Note that a compliant agent does not need to allow write access to this object.
    </description>
    </entry>
    </list>
    </oidlist>
    *Note that the xml file is not full die to 30000 character restriction of oracle's forum
    regards
    Edited by: user10484841 on Oct 19, 2010 6:07 PM
    Edited by: user10484841 on Oct 19, 2010 6:07 PM

  • Scan arrays from binary string

    I have TCP connection that is sending a great number of fixed size arrays that I need to convert. Is there a simpler way to do that than the one I have attached?
    Attachments:
    Scan from binary string.vi ‏16 KB

    Sorry, I didn't write my question clear enough.
    I know how to do TCP data transfer. I also know how to unflatten the binary string back to data, but I was hoping there was a clearer way to do it than the way I suggested. For scalar values one can make a cluster containing the data in the binary string and only one "unflatten from string" is needed.
    However, if the binary string is composed of arrays (even though they are fixed in size) I need one unflatten string for each array. In my case I have many small arrays. The attached example with only three arrays was only to illustrate what I wanted to do.
    I have now found a way using a cluster of clusters. I don't know if this is the ideal way of doing this, but it works, and when enabling "view cluster as icon" I can make the code much more compact and easier to read
    Attachments:
    2012-07-04_120216.jpg ‏385 KB

  • Binary String convertion.

    I've question on binary string convert to array of text/number.
    I'm tried to use GPIB read to retrieve a trace of Maxhold data (n number
    of frequency) from ESMI Spectrum Analyzer. however, those data always
    come out to binary string. So is there anyway i can convert Binary
    string --> ascii (in my case, array of number/text), or to retrieve
    readable data from the Spectrum Analyzer.
    Very appreciate for help.
    Jacky Wong

    I've question on binary string convert to array of text/number.
    I'm tried to use GPIB read to retrieve a trace of Maxhold data (n number
    of frequency) from ESMI Spectrum Analyzer. however, those data always
    come out to binary string. So is there anyway i can convert Binary
    string --> ascii (in my case, array of number/text), or to retrieve
    readable data from the Spectrum Analyzer.
    Very appreciate for help.
    Jacky Wong

  • Binary Strings

    Im trying to follow this tutorial - http://www.ai-junkie.com/ga/intro/gat3.html
    It represents the following values as binary strings e.g:-
    1 = 0001
    e.t.c
    9 = 1001
    * = 1100
    I can have worked out how to convert integers to binary string and visa versa,
    for(int i =0;i<10;i++){
                System.out.println(Integer.toBinaryString(i));
    }however I cant convert chars to binary of visa versa
    I have tried the folling buts its not working
    System.out.println(Byte.parseByte("1010" , 2));Thanks in advance
    Calypso

    calypso wrote:
    >
    What does this output, and what do you expect it to output? For me it outputs 10, and I expect it to output 10.
    >
    {noformat}
    In this tutorial, it is stated that
    "+" is equal to 1010
    How can I convert "+" --> 1010
    and
    how can I convert 1010 --> "+"
    {noformat}Well, you certainly didn't obtain "1010" by passing in a plus-sign to any method/Constructor of Integer, so I would suggest that you reverse whatever process you used to get 1010 in the first place.
    A simple method would be to use a map:
    Map<Character, String> toBinary = new HashMap<Character, String>();
    Map<String, Character> fromBinary = new HashMap<Character, String>();
       toBinary.put('9', "1001");  fromBinary.put("1001", '9');
       toBinary.put('+', "1010"); fromBinary.put("1010", '+');
    public String encode(char c) {
       return toBinary.get(c);
    public char decode(String binary) {
       return fromBinary.get(binary);
    }

  • Reading binary columns

    I have a generic read routine that works great for every data type I have encountered so far.
    But now I want to read a column that is defined as binary(20).
    The read code is:
    using (SqlDataReader rdr = cmd.ExecuteReader())
    int ivalCount = 0;
    while ( rdr.Read() )
    while (ivalCount < iCount)
    ne[ivalCount].Pt_Value = rdr[ivalCount].ToString();
    ivalCount++;
    The SQL table being read is:
    name nvarchar(50) Unchecked
    VEC nvarchar(50) Unchecked
    stat smallint Checked
    lan smallint Checked
    unit smallint Checked
    flags int Checked
    area_offset int Checked
    system_offset int Checked
    device_offset int Checked
    secondary_msg varchar(50) Checked
    alarm_flags smallint Checked
    pttype nchar(10) Checked
    web_message_id varchar(50) Checked
    web_point_status nvarchar(50) Checked
    sockaddr_in binary(20) Checked
    sockaddr_len int Checked
    Unchecked
    It works great except for the "binary(20)" field.
    In MS SQL Server Management Studio, the field appears as:
    0x02000400C0A80062000000000000000000000000
    But the code that reads the field gets:
    "System.Byte[]"
    Which strikes me as odd that the return would be the data type.  I sort of half expected a hexAscii string from the "toString"
    My main problem is I don't know what data type any field is before reading it.
    So what is the "best" way to read in the binary block, store it as hexASCII, not knowing first that it is a binary block?
    Recommendations?
    Boyd
    BDM

    Hello,
    You can try to use the SqlDataReader.GetDataTypeName method to get the data type of the specify column and then choose difference method to get the data of the column.
    Reference:
    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.getdatatypename(v=vs.110).aspx
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

Maybe you are looking for