Send array  to server

Hello,
I don´t know, how I send array with hexa number to
server. When I send this code so one last number take into server
wrong.
private function sendCommand(e:MouseEvent):void {
var ba:ByteArray = new ByteArray();
var i:int;
ba[0] = 0x01;
ba[1] = 0x00;
ba[2] = 0x00;
ba[3] = 0x01;
ba[4] = 0x18;
ba[5] = 0xC0;
telnetClient.writeBytesToSocket(ba.toString(16));
}

joly,
The type of data really doesn't matter, because all the bytes will ultimately be sent as ASCII characters no matter how it's done. There are many ways to handle this, with the main determining factors being:
- Are you running LabVIEW on both ends (client and server)?
- Do you want to use a higher level (easier to program) method, or a lower level method?
If you're running LabVIEW on both ends, then the easiest thing is probably to use DataSocket. It's easier because it abtracts away the overhead of casting/flattening your data to strings and keeping track of how many bytes are being sent and received. Check out "DS Writer.vi" and "DS Reader.vi" in the Example Finder (Help >> Find Examples, then Networking >> Data Socket >> General).
If you don't want the overhead of DataSocket, then you can use the primitive TCP read and write functions in LabVIEW. To learn how, look at "Simple Data Server.vi" and "Simple Data Client.vi" (in Example Finder under Networking >> TCP & UDP). They are sending a 1D numeric array by casting it to a string first; one wrinkle for you is that you can't use "Type Cast" with a 2D array. So, you would have to replace that primitive with "Flatten to String" instead, and you'd have to replace the Type Cast on the receiving end with "Unflatten from String" that has a dummy 2D numeric array wired into its "type" input.
If you're not using LabVIEW on the receiving end, then you have to write some program in some other language to receive the byte stream that is sent and recast it into an array object in that language. If you have access to a DataSocket API in that other language, then DataSocket is again the way to go. If not, you'll have to avoid DataSocket and build the receiving-end code yourself.
Hope it helps,
John

Similar Messages

  • Sending arrays from Excel into Labview

    I want to send an array from Excel VBA into a LabView VI.
    The Excel example shows how to send individual numbers and return an array into Excel but not send an array.
    Everything tried sends blank arrays into LabView, which can then be modified in LabView and returned to Excel.
    A VBA code snippit that does not work is:
    Sub LoadData()
    ' LoadData Macro
    ' Keyboard Shortcut: Ctrl+l
    ' This is an example to demonstrate LabVIEW's Active-X server capabilities.
    ' Executing this macro loads a LabVIEW supplied example VI "Frequency Response.vi",
    ' runs it and plots the result on an Excel Chart.
    Dim lvapp As LabVIEW.Application
    Dim vi As LabVIEW.VirtualInstrument
    Dim paramNames(0)
    Dim paramVals As Variant
    Set lvapp = CreateObject("LabVIEW.Application")
    viPath = lvapp.ApplicationDirectory + "\examples\apps\freqresp.llb\DAK Frequency Response.vi"
    Set vi = lvapp.GetVIReference(viPath)   'Load the vi into memory
    vi.FPWinOpen = True                     'Open front panel
    paramNames(0) = "Foo"
    paramVals = Sheet1.Range("j1:j1000").Value
    Call vi.Call(paramNames, paramVals)
    This code generates an error - expecting 1D array or variants.
    However, if I supply the correct array, then LabView thinks it is empty
    'foo' is a cluster
    'Array' is a double array
    Neither work to receive the data

    Thanks for the reply but that approach will be difficult.  The problem to solve is relatively simple IF LabView could read arrays (it writes arrays easily).  Here is the problem:
    I want to convolute two large arrays.  I have written VBA programs to do this but they take too long - over 30 sec whereas the LabView version take <1 sec IF I could get the data into LabView.
    The convolute is part of an optimization program that goes though many loops so that it takes hours to run efficiently AND if I manually change cells in the spreadsheet, then it takes 30sec to come back as VBA does not respect clean cells (for some reason).
    I was trying to write a function in VBA to do this calculation via LabView rather than VBA.  One way to  do this is to write a text file in VBA and read in LabView, then pass the results back or maybe the clipboard as a buffer.  That is faster but clumsy.  You could also have LabView look for dirty cells and then do the calculation as the server rather than the client.  Again, time consuming and cumbersome.  I have written pure LabView code to do the curve fitting but prefer to use Excel as that is easier to incorporate and work with the data.   You can do convolute using FFTs but Excel does not do that correctly - they CANNOT make their FFTs into a function (VBA functions cannot modify cells in the spreadsheet but only return variables.  FFT modifies cells so cannot be called from a function, only a macro, which then needs to be updated manually).  Again, I can kluge VBA (real kluge this time) to make FFTs work as a function BUT prefer the LabView solution, if possible, as I am not sure the FFT will actually save time.
    I am not sure if the problem is LabView's fault or Excel's (2013) fault that the variables are not set-up properly.  LabView claims to be able to do this.  Again, you can pass single variables into LabView and read back arrays but try as I might, I cannot get arrays into LabView.
    Any help in sending arrays (maybe Labview expects a variant variable and needs to convert it somehow) would be appreciated.  Variants are suppose to be able to be converted automatically but maybe there is a bug in LabView (2010) that does not handle input variant arrays correctly (I have tried making them clusters, double arrays, ect).  LabView thinks that all the arrays sent by VBA are empty. If LabView modifies the same array, VBA sees that modification so that the addresses appear to be sent correctly i.e. the array "handle" is being sent to LabView or else it could not fill the array to send back to VBA.
    If ever this is solved, I will put on-line the solution for others as again marrying both programs will have advantages.  Others may find this interesting is marry LabView with Excel so that LabView does some of the heavy calculations that Excel has kluged. 

  • How to send Array data using Post Method?

    Var array = $_POST['myData'];
    array[0] => 'ABC'
    array[1] => 'DEF'
    how to improve this code to support send array data...?
    String url ="http://xxxxx/test.php";
    String[] arraystr={"ABC", "DEF", "EDFF"}
    String parameter = "myData=" +arraystr;    // no support this
    Strint str = postMrthod(url, parameter );
    public static String postMethod(String url, String parameter) {
            StringBuffer b = new StringBuffer("");
            HttpConnection hc = null;
            InputStream in = null;
            OutputStream out = null;
            try {
                hc = (HttpConnection) Connector.open(url);
                hc.setRequestMethod(HttpConnection.POST);
                hc.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
                hc.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                out = hc.openOutputStream();
                byte postmsg[] = parameter.getBytes();
                for (int i = 0; i < postmsg.length; i++) {
                    out.write(postmsg);
    out.flush();
    in = hc.openInputStream();
    int ch;
    while ((ch = in.read()) != -1) {
    b.append((char) ch);
    } catch (IOException e) {
    e.printStackTrace();
    try {
    if (in != null) {
    in.close();
    if (hc != null) {
    hc.close();
    } catch (IOException e) {
    e.printStackTrace();
    return b.toString().trim();

    yes, you can send integer value like this. But I think you have to put quotes around <%= TAMID%> i.e.
    <input type="hidden" id="HTTP_CVHTAMID"
    name="HTTP_CVHTAMID" value= "<%= TAMID%>" >

  • Can CAS array include server in DR site

    Hi, there:
    Our current Exchange 2010 environment:
    1): Two HUB/CAS Exchange 2010 server running on Windows 2008 R2 use NLB to form a CAS array.
    2): Two Exchange 2010 Mailbox server with one DAG.
    Please note all of these Exchange 2010 servers are on our datacenter, now we would like to add the DR capability to our Exchange environment.
    In regards to the CAS array design for the DR site, is it possible to add one HUB/CAS Exchange 2010 to current CAS/HUB array (this server need to be on SR site), this way when the two HUB/CAS server on the datacentre is not available user can still connect
    the HUB/CAS server on the DR site?
    If the subnet for the Datacentre and DR site is different is this possible?
    If the subnet for the datacenter and DR site is the same is this possible?

    Hi,
    Firstly, I’d like to explain, CAS array’s members cannot be located in different sites. If all CAS servers are in the same site, CAS array can load balance MAPI request.
    And if all mailbox severs are in the same site, DAG can apply failover while it may apply switchover if they are in different sites:
    http://technet.microsoft.com/en-us/library/dd298067(v=exchg.141).aspx
    A failover is an automatic activation process that can occur at either the database or server level. Switchover is manual activation process.
    If you have any question, please feel free to let me know.
    Thanks,
    Angela Shi
    TechNet Community Support

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • An error occured while sending mail: SMTP server error.  The server responded: (null)

    I'm getting this set of error messages intermittantly:
    <P>
    An error occured while sending mail: smtp server error
    the server responded: (null) contact email admin
    for assistance
    other message
    an error occured while sending mail: smtp server error
    the server responded: intermail,
    end with quote.quote contact email admin
    for assistance
    <P>
    This problem may occur at low-use times when Messaging is installed with the
    Trend virus protection software on the same system.
    <P>
    Change the version of the Trend software from 3.0 to the older 2.62 version.

    It's possible that your provider has made a change.
    I think STARTTLS usually is used with port 587, instead of the standard SSL port 465.
    Could you look up your provider's current SMTP settings to see whether your "Outgoing Server" settings need to be updated? If it's difficult to translate between your provider's help page and Thunderbird's dialog controls, you could provide a link to your provider's help page.

  • How to send array of bytes to a servlet and store it in a file

    Hi,
    How to send array of bytes to a servlet and store it in a file.
    I am new to Servlets. if possible for any one, please provide the code.
    Thanks,
    cmbl

    Through HTTP this is only possible with a POST request of which the encoding type is set to multipart/form-data. You can use Apache Commons FileUpload to parse such a multipart form data request into useable elements. From the other side (the client) you can use a HTML <input type="file"> element or a Java class with Apache Commons PostMethod API.
    You may find this article useful: http://balusc.blogspot.com/2007/11/multipartfilter.html

  • Best Way To Send Arrays to ActiveX

    What's the best way to send array data to an ActiveX object? Do you
    have any examples that you can show me? Are there any alternatives to
    the "best way"?
    Thanks,
    Scott

    > What's the best way to send printer control codes in Netware 3.12? Should
    > I use a batch file that's run each time a particular queue is selected, or
    > is there something I should be doing with a pconsole option? I'm trying to
    > get rid of extra linefeeds and enable compressed printing. DOS
    > environment, by the way.
    Never mind, I'm in a habit of answering my own posts these days. Just create
    a job configuration in printcon that uses a device with the appropriate
    device modes.
    Is it just me, or is Netware queue-based printing a bit on the obtuse side?
    Seems like it could have been made a whole lot easier (more linear?) to set
    up.
    --Mike-- Chain Reaction Bicycles
    www.ChainReactionBicycles.com

  • Can any one help me sending Oracle application server Cloning  document 9.0.4 version

    Can any one help me sending Oracle application server  Cloning document 9.0.4 version (Mail id removed by moderator)
    Many Thanks in advance
    Deepak

    Hi Deepak,
    In first place application server 9.0.2 is desupported since 30th June 2007.So oracle would always recommend its customer to be on the latest versions.
    Please follow the below URL for cloning Appplciation Server 9.0,.4
    Cloning Application Server Middle-Tier Instances
    Regards,
    Prakash.

  • Can't send mail with Server 10.4.8

    Yes... I'm very new at this.
    I've got 10.4.8 server set up as a mail server, with SMTP enabled. I think I have DNS configured properly, but I can't send email. I can recieve email. If I run mail (ie, the command "mail") from the terminal, I can send any user email, and they can retrieve that email using the Mac mail app. However, when I try to use the mail app to send, I get the error "cannot send message using the server dns.cha.com". I'm sure I'm doing something very obviously wrong. Following is a dump of postconf -n. Any help out there?
    Thanks,
    Eric
    dns:~ esmith$ postconf -n
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    debugpeerlevel = 2
    enableserveroptions = yes
    html_directory = no
    inet_interfaces = all
    mail_owner = postfix
    mailboxsizelimit = 0
    mailbox_transport = cyrus
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    mydestination = $myhostname,localhost.$mydomain,localhost
    mydomain = cha.com
    mydomain_fallback = localhost
    myhostname = dns.cha.com
    mynetworks = 127.0.0.1/32,dns.cha.com,10.0.1.7,10.0.1.4
    mynetworks_style = host
    newaliases_path = /usr/bin/newaliases
    queue_directory = /private/var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtpdpw_server_securityoptions = none
    smtpdrecipientrestrictions = permitmynetworks,reject_unauthdestination,permit
    smtpdsasl_authenable = no
    smtpdtls_certfile = /etc/certificates/Default.crt
    smtpdtls_keyfile = /etc/certificates/Default.key
    smtpduse_pwserver = no
    smtpdusetls = no
    unknownlocal_recipient_rejectcode = 550

    Thanks for the info. Unfortunately, I still have the same trouble sending mail: it works from the command line, but not from the mail application. The mail error is "cannot send message using server xxx.xxx.xxx", which is the same message that would be sent even if I entered a bogus mail server address. I use the same machine name for the SMTP server and POP server. When I watch the connections pane, I see my computer making a POP connection to get mail, so the DNS must be OK.
    Here's the config again... thanks for any help you can offer!
    dns:~ esmith$ postconf -n
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    debugpeerlevel = 2
    enableserveroptions = yes
    html_directory = no
    inet_interfaces = all
    mail_owner = postfix
    mailboxsizelimit = 0
    mailbox_transport = cyrus
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    mydestination = $myhostname,localhost.$mydomain,localhost
    mydomain = cha.com
    mydomain_fallback = localhost
    myhostname = dns.cha.com
    mynetworks = 127.0.0.1/32,10.0.1.0/24
    mynetworks_style = host
    newaliases_path = /usr/bin/newaliases
    queue_directory = /private/var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtpdpw_server_securityoptions = none
    smtpdrecipientrestrictions = permitmynetworks,reject_unauthdestination,permit
    smtpdsasl_authenable = no
    smtpdtls_certfile = /etc/certificates/Default.crt
    smtpdtls_keyfile = /etc/certificates/Default.key
    smtpduse_pwserver = no
    smtpdusetls = no
    unknownlocal_recipient_rejectcode = 550

  • When I try to send mail to multiple addresses, it tells me it cant send with selected server.  It sends mail to one address fine.

    When I try to send mail to multiple addresses, it tells me it cant send with selected server.  It sends mail to one address fine.

    contact your email service provider and ask them (it might treat multiple e-mails as SPAM)

  • I have a macbook (late 2011). I have a yahoo and gmail act.'s configured wrong in mailbox. Every time I attempt to send, the email comes back stating that yahoo cannot send with the server. I have changed things around to no avail. Please advise.

    I have a macbook pro (late 2011) OS X Yosemite 10.10. I have 2 acct.’s set up in mailbox, Yahoo and Gmail, but it will not send. The message comes back stating that Yahoo cannot ‘send using the server’....I have manipulated things around but to no avail. Both acct.’s receive, but will not send. Can someone provide some answers? Thanks.

    Hi whineyfromleessummit, 
    Thanks for visiting Apple Support Communities. 
    It sounds like you're not able to send email from Yahoo or Gmail on your MacBook Pro. 
    There could be several causes of the behavior. I would start with the troubleshooting steps in the "Mail Connection Doctor shows one or more red dots in the account Status column" section of this article:
    OS X Mail: Troubleshooting sending and receiving email messages
    This article contains a variety of steps that can help resolve an issue like the one you're seeing. 
    All the best,
    Jeremy

  • Apple mail not sending via my server hotmail.

    apple mail not sending via my server hotmail.  Please help

    How would you like us to help when you don't provide any details.  We don't have a crystal ball.

  • After Mavericks download iCal doesn't work, still - sending calendars to server.... nothing more, please help what to do Tx

    after Mavericks download iCal doesn't work, still - sending calendars to server.... nothing more, please help what to do Tx

    I had some initial problems with iCal too. At least for me deleting the prefs file solve them. The file is: com.apple.iCal.plist  and it is in your Library/Preferences folder
    The other thing your problem appears to be connecting to the server is to quit Calendar and then open System Preferences, select the Internet Accounts, and toggle off the Calendar checkmark of each of your calendar accounts. Quit System Preferences. Start the calendar. Since you've turned off the calendar server accounts there should be no beachballing. Quit, return to System preferences and re-enable one calendar account at a time. (This assumes that you are using more than iCloud Calendar) and then start Calendar again. And finally, for one particularly obnoxious iCloud issue I wound up deleting my iCloud account in System Preferences and then recreating it. (Same account name, etc, I just killed the account on my computer so I could start out with fresh preferences).

  • Sending byte array to server

    Does anyone know how to send a byte array to the server?

    What is contained in the byte array? Is it audio/video/image?
    If you can get a binary representation of it, you could probably
    convert it to Base64 and send it over as a string and reconvert to
    binary on the server.

Maybe you are looking for