How to send a picture with ClientTCPWrite

Hello

I would like to send a large picture (in fact a photo) to another computer via a TCP server.

I already use the library to Support TCP to send data to a software that is running on another computer and it works well.

So I did the same thing with an array of integers, and it does not work. I used the sample of Labwindows to send this table, and that the first part of the table is received aid.

I don't understand.

int SendImage(BYTE *lDataToWrite)
{
DWORD dwWaitResult;
int bytesToWrite;
int bytesWritten;
int messageSize;

If (giTCPConnected1 is TRUE)
{
bytesToWrite = messageSize = sizeof (BYTE) * WIDTH * HEIGHT;
While (bytesToWrite > 0)
{
bytesWritten = ClientTCPWrite (giTcpConnection1 & lDataToWrite [messageSize - bytesToWrite], bytesToWrite, 0);
bytesToWrite = bytesWritten;
}
}

Return (ERROR_NO_ERROR);
}

	Tab WORD [WIDTH * HEIGHT];

...
...

int CVICALLBACK ReceiveTcpMsg(unsigned hdl, int event, int error, void *callbackData) {}
int iDataSize;
int i, j;

DWORD dwWaitResult;
int bytesToRead;
int bytesRead;

switch (event)
{
case TCP_CONNECT:
giTcpConnection = hdl;
giLineConnected = TRUE;
break;

case TCP_DATAREADY:
Reading data tcp/ip

bytesToRead = messageSize = sizeof (WORD) * WIDTH * HEIGHT;
While (bytesToRead > 0)
{
bytesRead = ClientTCPRead (giTcpConnection, & Tab2 [messageSize - bytesToRead], bytesToRead, 0);
bytesToRead = bytesRead;
}

break;

case TCP_DISCONNECT:
giLineConnected = FALSE;
break;
}
Return (0);
}

Is that someone has already used these functions to a large size?

Or you know other ways to send a picture to another software?

Thank you for your help.

Benjamin

When I had to do something similar to your task, I found more comfortable to split the expedition into smaller pieces (more or less 3-4 k bytes of each for example).

It also gave me the ability to monitor the process of ethe and finally to interrupt.

Tags: NI Software

Similar Questions

  • How can I take pictures with a regular usb camera and labwindows

    How can I take pictures with a regular usb camera and labwindows

    Hello

    What do you mean "ordinary USB camera? It's a Vision camera with a communication based on the API Vision camera or a 3rd party (such as a webcam)?

    In the latter case, you may need to consult the documentation of the manufacturer, it should be sent with her library (C DLL, ActiveX automation, .NET assembly) with functions to communicate with drivers.

    Best regards

  • How to send a mail with attachment no matter what file use the invoke in os 6.0?

    Hello

    There is some issue that how to send a mail with attachment to use the invoke method in os 6.0?

    "I use the Transport at this time mail send successfully, but I use the invoke to throw this error time these error ismail service does not support these tyes of change of parts joined the send using field or remove attachments ' so how do?

    Thank you

    Hi, rishabh

    Thanks.i got the solution and super work Super-Duper hit.

    Thnaks,

    Umang.

  • How to send the picture of u with labview

    Hello

    How to send table unsigned 32-bit via UDP.

    How to convert the 32-bit unsigned byte array table.


  • Sending pictures to option is grayed out. How to send the picture using Windows Photo Gallery?

    Original title: Gallery

    I would like to know how to send an image to a file open. When I choose "" send to "this option is"greyed out"."

    Do you use "Windows Photo Gallery" of Vista, or a third party library?  ' Send to ' is not normally associated with the images of the Windows Photo Gallery in Vista?

    Photos from the photo gallery Windows send to Flash memory
    http://social.answers.Microsoft.com/forums/en-us/vistapictures/thread/60055083-019c-44e0-b5d4-ba0640bd4522

  • How to make a picture with my webcam to use facebook and other Web sites

    Please tell me how to take pictures with my webcam [toshiba laptop sateliteL755] and keep them to use sites like FACEBOOK, SKYPE soceal media!

    Contact support staff who made the webcam.

  • How to send an email with the link that has the user id?

    Hello everyone, I'm trying to send an email with the link that includes the user id. After users click the link, they should be able to see the form with their information that has been previously fulfilled. So my question is after I have send email how and what is the best way to get information and show it to the user. What should be separate page with the cfquery limited on the id user or something else? If anyone has an idea of what is the best way to do it please let me know. I already have my code who send e-mails.

    You save all the fields submitted initially to a database?  If so, run a query and then convert them to the form field, query values. I don't know what looks like your data (or database), but a simplified version might look like this.

    SELECT FirstName

    OF SavedFormTable

    WHERE ID =

  • How to send an email with a header/footer in the body of the email?

    I try to send an email with a PDF attachment but a need to have a static header and footer in the body of the email before sending it.  How this is done and it is possible to do? I am new to this and don't know how to start this.  Any help with this is greatly appreciated.  Thank you.

    You can put information in the body of the email, but you are limited on formatting. Here's a post from Stefan Cameron with example that I think will really help you.

    http://Forms.stefcameron.com/2008/08/28/submitting-form-data-by-email/

  • How to send a fax with a scanned document

    I need to send a fax with 4 pages of document I scanned, but when I go on my page of the Fax Console it gives me the option to include my documents? !!!

    Open the document in any application that will allow you to see.  Click file > print.  In the print dialog box, click the drop-down arrow and select the "Fax" printer  Click on print, then follow the prompts in the Send Fax Wizard.

  • How to send a mail with attachment

    Hi friends,

    I am using soa 11.1.1.6
    Jdev 11.1.1.6
    WebLogic:-11.1.1.6

    I want generated e-mail with attachment in BPEL 11 g. Here's what I did in my bpel process

    Create processes bpel from simple Hello world.

    In the e-mail activity below details are given

    < name of scope = "Email1" >
    < bpelx:annotation >
    < bpelx:pattern = "bpelx:email" patternName > < / bpelx:pattern >
    < / bpelx:annotation >
    < variables >
    < variable name = "varNotificationReq".
    messageType = "ns1:EmailNotificationRequest" / >
    < variable name = "varNotificationResponse".
    messageType = "ns1:ArrayOfResponse" / >
    < variable name = "NotificationServiceFaultVariable".
    messageType = "ns1:NotificationServiceErrorMessage" / >
    < / variables >
    < name of sequence = sequence of '1' >
    < assign the name = "EmailParamsAssign" >
    < copy >
    < expression = "string ('Default')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:FromAccountName" / >
    < / copy >
    < copy >
    < expression = "" string ()"/ >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:Bcc" / >
    < / copy >
    < copy >
    < from expression = "string ('[email protected]')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:Cc" / >
    < / copy >
    < copy >
    < expression = "" string ()"/ >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:ReplyToAddress" / >
    < / copy >
    < copy >
    < expression = "string ('testing')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload / ns1:Subject" / >
    < / copy >
    < copy >
    < from expression = "string ('[email protected]')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: to" / >
    < / copy >
    < copy >
    < delivery > < xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > < MimeType xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > multipart/mixed < / MimeType > < ContentBody xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > < MultiPart xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > < BodyPart xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > < MimeType xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" / > < ContentBody xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" / > < BodyPartName xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" / > < / BodyPart > < BodyPart xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" > < MimeType xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" / > < ContentBody xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" / > < BodyPartName xmlns = "http://xmlns.oracle.com/ias/pcbpel/NotificationService" / > < / BodyPart > < / MultiPart > < / ContentBody > < / content / > < / from >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = ' / EmailPayload/ns1: Content "/ >
    < / copy >
    < copy >
    < from expression = "string (" text/html; Charset = UTF-8 ")" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [1] / ns1:MimeType" / >
    < / copy >
    < copy >
    < from expression = "" Hi"" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [1] / ns1:ContentBody" / >
    < / copy >
    < copy >
    < expression = "string (' application/xml'); "/ >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [2] / ns1:MimeType" / >
    < / copy >
    < copy >
    < expression = "string ('result.xml')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [2] / ns1:BodyPartName" / >
    < / copy >
    < copy >
    < expression = "bpws:getVariableData('outputVariable','payload','/client:processResponse/client:result')" / >
    < variable = part of the "varNotificationReq" = "EmailPayload."
    Query = "/ EmailPayload/ns1: Content / ns1:ContentBody / ns1:MultiPart / ns1:BodyPart [2] / ns1:ContentBody" / >
    < / copy >
    < / assign >
    < call name = "InvokeNotificationService".
    portType = "ns1:NotificationService."
    partnerLink = "NotificationService1."
    variableentree = "varNotificationReq".
    outputVariable = "varNotificationResponse."
    operation = "sendEmailNotification" / >
    < / sequence >
    < / scope >


    I'm able to generate E-mail with an attachment, but I do not see that the xml data in the attached file yet the file size is 64 b.

    I think I need to convert the data before sending it as an attachment. Could someone help me please by generating the XML.

    Kind regards
    Tarak

    Hi Tarak,

    You need not specify the MIME Type such as application/xml you don't read a .xml file.

    I'm assuming you are trying to send the result with its XML form variable in the attachment. So, follow the following steps to achieve the same (basically only first steps as my blog).

    -Open the e-mail from the Design view activity and go to the Attachments tab
    -Define the MIME Type such as text/plain; (no need to set as xml) and the name of the attachment as result.xml (what you do already)
    -The content to write this:

    ora:getContentAsString(bpws:getVariableData('outputVariable','payload'))
    

    ora: getContentAsString() function returns you the resulting data in its xml form.

    Be sure to check changes to the source code also like my Jdeveloper, they don't think is in Design view. Test and let me know if the problem persists.

    Kind regards
    Neeraj Sehgal

  • How to make a picture with my webcam?

    I would like to take a picture of me with my webcam and save in my pictures... I can't understand how do without having to download a program.

    Thank you!

    You need the camera software.  Who is on the Acer site under your model or on the disk driver and application, if you did your recovery disks. The software will allow you to switch between still photos and videos also.

  • How can I open picture with one. MIX the extention of file

    A few photos on my computer stops have one. Extension of file MIX and w' opened. What causes this

    A few photos on my computer stops have one. Extension of file MIX and w' opened. What causes this

    ========================================
    Some. MIXTURE of files created with Microsoft
    PhotoDraw but more that likely... they were created
    with Microsoft Picture It!.

    (to open the PhotoDraw files... you have PhotoDraw)

    The picture it!. requires format Mix (extension)
    Ms Picture It! or MS Digital Image.

    If you need an application to open files with... you
    could use the trial version of 60 days of digital
    2006 image.

    Even if you have the .mix files... it might be
    a good idea to save them in a more universal
    .jpg, .png, or .tif format. You can make a
    lot in Digital Image if you are going to...
    ...... Editing / Edit in Mini Lab to batch / save under...

    The number of files that you can convert simultaneously
    depends on your system resources but I
    would try 50 and see what happens.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Microsoft Digital Image
    Starter Edition 2006
    http://www.Microsoft.com/downloads/en/details.aspx?FamilyId=7C3B3DED-A15F-48C5-B724-7796FE8C151E&displaylang=en
    (this product line has been
    abandoned, but you can still
    Download the Starter Version
    and run it to 60 days)

    Another option...

    How to see and/or convert. Picture It!. mix files.

    If you have any version of MS Picture It! / MS
    Digital image... give it a try.

    If they are single image files that have been created
    with MS Picture It!... the following information can be
    your solution:

    The evaluation version of PolyView may allow
    lot to reformat your .mix files.

    You can download an evaluation copy to the
    following link:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    PolyView
    www.Polybytes.com
    (Go to...) Downloads / PolyView 4.42 Setup
    Program)

    When you open PolyView... go to...
    File / Format Conversions...

    Navigate to the folder that your .mix files
    recorded in and open the drop window and
    Choose "All Files".

    On the left, click on the button "add all".

    On the left, click on the button "continue"...

    Choose your JPEG Format 'Destination '.

    Choose your JPEG quality... 100

    Choose a 'Destination folder '...

    Left click on the button 'start '.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How to send a fax with eFax

    This is a video that shows how we can send an efax once they have implemented the efax account.

    Printers which deals with this video are the following.

    • Photosmart 7510
    • Photosmart eStation C510
    • ENVY 100
    • Want to 114
    • Officejets have no accounts free eFax as a feature available at the moment.

    I hope it's useful. Good impression!

  • How to send a picture by Bluetooth using Windows 8-way

    I selected a photo via pictures tile, drag the right side and choose 'Sharing', I can't find the option to use bluetooth to send the photo to my friend who has the phone bluetooth...

    Note that I added my friend bluetooth device in the "Device" option to the forehand bar already...

    The current workaround is to use the old and no Windows 8 path via Office send the image via bluetooth... But this only defeated the purpose of showing what the new concept in tiles/Start of Windows 8...

    No idea how?

    Thank you!

    It is ACTUALLY how this in Windows 8... no idea what the other poster was thinking, but in most cases, there are a few thing missing in step by step preceding... as moving to the left does not bring to the top of the search appsicon.

    In any case.

    1. Add your BT device through Control Panel-> devices menu and make sure it is coupled.  THIS MUST BE MADE BEFOREHAND.

    2. in the window of your desktop, click on the Bluetooth icon in the notification area (you may need to press the icon of development according to the system icons How are present).

    3. Select "send a file".

    4. Select the device you want to send to, and then click Next. (this is why it needs to be paired FIRST, mentioned in step 1).

    5. you now need to select the window or files.  Locate the file you want to send; Click Open, and then click Next.

    6. If your device is not set to always allow, you will need to accept/approve receive the file on your device.

    7. click on finish once the shipment is completed.

  • How to export a picture with the filename

    iPhotos used to export a photo in a chosen directory, and then type a file name then export it. Apparently the 'upgrade' to Photos (ver. 1.2) means that I can give is no longer the photo file name specific when I export.

    The closest I can get, it's choosing prefix sequential and then I am able to type a file name that will show in front of the sequential number.

    so the name of the file appears as: myphoto - 1.jpg

    which is a stupid file name and I'll end up editing in any case until I have download or attach to a message.

    No cases of type a file name as you used to be able to do with iPhoto

    Photoshop Elements allows a file name be entered when you save a file. How can he NOT be an option in Photos?

    Is there a 3rd party add ons or an update that will give me the capacity back to name the files when exporting?

    Thanks for any help.

    If you use the settings as you have:

    you will get this for the exported file:

    The resulting file name should not be stupid because that's what you entered.

    If it is for a single file and then change the title below the thumbnail

    and use the name of the file: title. You will get the same results without the sequence number.

Maybe you are looking for

  • is it possible to obtain external C++ code serial number?

    Hello I have a C++ library called by an FCM in the LabVIEW RT from my cRIO. I try to use the serial number of the cRIO in my C++ code licensing. Is it possible to get the serial number of the cRIO using the C++ API? I found information on how to do i

  • HP Compaq nx9420 upgrade memory

    I want to install the HP recommended update for this product ie 2 x 2048 MB. I can only find 1 bar of memory under the keyboard. Does anyone know where is the other module?

  • Auto Sync freezes

    I have 8 GB Fuze and initially loaded some 1000 songs Ok. Now, when I try to auto-synch I got at about 1130 and stops the synchronization operation. Info tells me I always free 2925 MB. Firmware is V02.01.17A I re-formatted, reset, and delete "mtable

  • Recent update with KB947821, may 2013, failures to receive the 9370001 error code.

    I have Windows Vista 64 SP2 and could not update KB947821, may 2013, receive the error code 9370001.  I tried several times and found no mention in this error online code. Did someone did with the line this problem? I'd appreciate any help! Thank you

  • File search Windows 7 won't be back for results unless I have change file name

    problem: if I'm looking for a car for a file or folder that I know is there (any type of file), it won't be back for results, but if I change the name of the file, it will then find. For example, if I search: movie.mp4 it won't, but if I go and chang