How to get the number of bytes at TCP port

Hi all,
How to get the number of bytes to read at the TCp port...as someone had suggested in some forum we do read the number of bytes first and then pass this...
but we get a problem when we have FF data in this...because then it sends 2 FF data...and cause of this we skip the last data...is there any solution for the same?

Hi
In LabVIEW you don't have the same property as in serail port.
You havn't "Byte at TCPIP port".
if you developp a protocol, one soltion, is to send the size to read.
Ingénieur d'Application / Développeur LabVIEW Certifié (CLD)
Application Engineer / LabVIEW Certified Developer (CLD)

Similar Messages

  • How to get the number of bytes at ethernt port using tcp/ip?

    I have data with variable sizes.I am getting the data from another sytem using software C.
    How can I get the exact number of bytes coming at the port before using the read command so that the no. of bytes at port has to be given as the input to the tcp read vi?

    Philippe_RSA wrote:
    So may responses saying your question is wrong..... typical of this site, and no decent answer after 5 years !
    The answer I have used is to use a call library function:
    short int ioctlsocket(unsigned long socket, unsigned long fionread, unsigned long *len);    
    where fionread is a windows defined constant =  4004667F
    The socket can be obtained from using the       TCP Get RAW NET OBJECT.vi   which comes with Labview (even as far back as version 7).
    Good luck.
    A protocol requiring such a hack is IMHO very poorly designed. You should always have some way on the wire to determine the data stream size. If the data is fixed size that would be inherent to the protocol, if it's variable sized there should be a fixed size header or a known message termination indication that can be used to determine how to read the rest of the message.
    As a side node, I do consider the existence of VISA Bytes at Serial Port a big error, and that is most likely where this question originally came from. Use of "bytes at port" to decode a protocol will ALWAYS lead to protocol errors sooner or later, and code that is unneccessarily complicated to force the routine to deal with the asynchonous reading of the "bytes at port" into the protocol decoding.
    If a protocol can't be decoded with fixed size reads, fixed size reads with following variable size reads determined from information in the header, or a specific message termination indication, then it is very badly flawed.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to get the number of bytes stored in a field?

    Hi Guys,
    How can i get the number of bytes stored in a field.
    I tried using DESCRIBE FIELD, But here i am getting the length from the definition.
    i.e 8 bytes for string and for character value is from definition.
    Prompt replies will be Awarded with full points:-)
    Thanks,
    vinod.

    u see this : http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f2e5446011d189700000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f2e5446011d189700000e8322d00/frameset.htm
    Madhavi

  • Indesign CS3: How to get the number of the current layer?

    Hallo!
    How to get the number of the current layer in a page?
    Thanks,
    Alois Blaimer

    InterfacePtr<ILayerList> layerList(documentUIDRef, UseDefaultIID());          <br /><br />int32 layerCount = layerList->GetCount();<br /><br />To findout layer name use<br /><br />IDocumentLayer* documentLayer = layerList->QueryLayer(layerIndex);<br />                         <br />PMString layer=documentLayer->GetName();

  • How to get the number of columns in a result set???

    hi everyone..
    i am trying to establish a servlet applet communication....
    my applet send the sql query to the servlet as serialised string and then the servlet executes the query...
    Since i need to pass the result back to the applet, i thaught of passing the whole reult set to the applet..but that seems to be not possible..
    so i thaught of storing my result set data in a vector and then pass the vector,but the first problem that i came across is that how to get the number of colums in a result set....
    so is there a way to get the number of columns in a result set...???
    and also i would like to know if it possible to send my whole result set to the applet bye serialization or by any method...???
    thanx in advance

    You shouldn't do. It expenses resources (you should always close the ResultSet and the Statement as fast as possible). Simply gently process it into a Collection or Map of DTO's. Those are serializable.

  • How to get the number of files currently open?

    hi,
    does any one know how to get the number of files currently open in windows OS?
    e.g. lets say .txt files...
    any comment will be really appreciated.
    thanks

    Assuming that you don't want to actually do this from within Java code (which would obviously require native code), here's a utility that will give you a list of which file handles are opened by which processes (on Windows):
    http://www.sysinternals.com/ntw2k/freeware/handle.shtml
    - K

  • How to get the number of elements in DB

    Could you tell me how to get the number of elements in DB??
    My code to get the number is below, but I think it is not efficient
    DB->cursor(DB, NULL, &cursorp, 0);
    while ((ret = cursorp->c_get(cursorp, &key, &data, DB_NEXT)) == 0)
    count++;
    --------------------------------------------------------------------------------------------------------------

    Hi,
    The most efficient way to get a count from the database is using the DB->stat API (http://docs.oracle.com/cd/E17076_02/html/api_reference/C/dbstat.html)
    The code will be something like:
            DB *dbp;
            DB_BTREE_STAT *statp;
            int ret;
            /* Print out the number of records in the database. */
            if ((ret = dbp->stat(dbp, NULL, &statp, 0)) != 0) {
                    dbp->err(dbp, ret, "DB->stat");
                    goto err1;
            printf("%s: database contains %lu records\n",
                progname, (u_long)statp->bt_ndata);
            free(statp);The code comes from the example included in the distribution at examples/c/ex_btrec.c
    If the database isn't a btree, you should update to the appropriate statistics structure and field.
    It's worth noting that retrieving the count is never a "cheap" operation. The count is not stored in the database - since doing so introduced a single point of contention that creates a bottle neck.
    Regards,
    Alex Gorrod
    Oracle Berkeley DB

  • How to get the number of messages consumed by a MDB ??

    Hi all,
    How to get the number of messages consumed by a MDB displayed in OEM in a Java Application ???
    DMS ??? what use DMS ???
    tanks

    ok.
    Well using DMS is one way to get at these sorts of stats in a programmatic manner.
    There's a Java API you can use, or you could call out to the Spy servlet to query the DMS stats in either text or XML form.
    I don't have an MDB published so I can't show you specifiically, but here's the sort of query you can use to extract the data.
    http://localhost:8888/dms0/Spy?format=raw&table=oc4j_ejb_stateless_bean&recurse=children
    Which produces a table of the TEXT form:
    <DMSDUMP version='9.0.4' timestamp='1163456821185 (Tue Nov 14 08:57:01 CST 2006)' id='8888' name='OC4J'>
    <statistics>
    /oc4j [type=n/a]
    /oc4j/default [type=oc4j_ear]
    /oc4j/default/EJBs [type=oc4j_ejb]
    /oc4j/default/EJBs/jmsrouter_ejb [type=oc4j_ejb_pkg]
    /oc4j/default/EJBs/jmsrouter_ejb/AdminMgrBean [type=oc4j_ejb_stateless_bean]
    pooled.count:     11     ops
    pooled.maxValue:     1     count
    pooled.minValue:     0     count
    pooled.value:     0     count
    ready.count:     11     ops
    ready.maxValue:     1     count
    ready.minValue:     0     count
    ready.value:     0     count
    session-type.value:     Stateless     
    transaction-type.value:     Bean     
    /oc4j/default/EJBs/jmsrouter_ejb/EnqueuerBean [type=oc4j_ejb_stateless_bean]
    pooled.count:     11     ops
    pooled.maxValue:     0     count
    pooled.minValue:     0     count
    pooled.value:     0     count
    ready.count:     11     ops
    ready.maxValue:     0     count
    ready.minValue:     0     count
    ready.value:     0     count
    session-type.value:     Stateless     
    transaction-type.value:     Bean     
    /oc4j/default/EJBs/jmsrouter_ejb/TimerHandlerBean [type=oc4j_ejb_stateless_bean]
    pooled.count:     11     ops
    pooled.maxValue:     0     count
    pooled.minValue:     0     count
    pooled.value:     0     count
    ready.count:     11     ops
    ready.maxValue:     0     count
    ready.minValue:     0     count
    ready.value:     0     count
    session-type.value:     Stateless     
    transaction-type.value:     Bean     
    </statistics>
    </DMSDUMP>
    Or produces an XML document of the form:
    http://localhost:8888/dms0/Spy?format=xml&table=oc4j_ejb_stateless_bean&recurse=children
    You can use the Spy console to find the table that contains the details for MDB and then take it from there.
    This is not what you specifically want to do, but it does provide a good overview of how DMS is used.
    http://www.oracle.com/technology/pub/notes/technote_dms.html
    -steve-

  • How to get the number of decimal places configured for a site column

    Hi,
    I have a column 'SampleNumCol' of type Number, the number of decimal places to be displayed is configured as 2.
    The column conatins a value, but when retrieved programatically is displayed as 5.00000000  instead of 5.00.
    I am retrieving this column using listitem.Properties[field.InternalName].
    I need to trim the decimals based on  number of decimal places configured for the site column.
    How to get the number of decimal places configured for a site column?
    Thanks in advance,
    dhijit

    Get the field as SPFieldNumber and then check DisplayFormat which returns
    SPNumberFormatTypes
    SPFieldNumber numberField = list.Fields.GetFieldByInternalName("YourNumberFieldName") as SPFieldNumber;
    SPNumberFormatTypes numFormatType = numberField.DisplayFormat;

  • How To get the number of request's for a single Composite Application

    Hi can any body tell how to get the number requst's for a single composite application.
    Thanks
    Mani

    Hi,
    There are lots of STATE is available for composite instances, like mentioned in the below query. I hope you will get answer from the below query.
    SELECT (CASE WHEN STATE=1 THEN 'OPEN AND RUNNING'
    WHEN STATE=2 THEN 'OPEN AND SUSPENDED'
    WHEN STATE=3 THEN 'OPEN AND FAULTED'
    WHEN STATE=4 THEN 'CLOSED AND PENDING'
    WHEN STATE=5 THEN 'CLOSED AND COMPLETED'
    WHEN STATE=6 THEN 'CLOSED AND FAULTED'
    WHEN STATE=7 THEN 'CLOSED AND CANCELLED'
    WHEN STATE=8 THEN 'CLOSED AND ABORTED'
    WHEN STATE=9 THEN 'CLOSED AND STALE'
    WHEN STATE=10 THEN 'NON-RECOVERABLE'
    ELSE STATE || ''
    END) AS STATE, component_name, COUNT(*) AS NUM_OF_CUBE_INST FROM CUBE_INSTANCE where composite_name='PASS THE COMPOSITE NAME HERE..........'
    group by (CASE WHEN STATE=1 THEN 'OPEN AND RUNNING'
    WHEN STATE=2 THEN 'OPEN AND SUSPENDED'
    WHEN STATE=3 THEN 'OPEN AND FAULTED'
    WHEN STATE=4 THEN 'CLOSED AND PENDING'
    WHEN STATE=5 THEN 'CLOSED AND COMPLETED'
    WHEN STATE=6 THEN 'CLOSED AND FAULTED'
    WHEN STATE=7 THEN 'CLOSED AND CANCELLED'
    WHEN STATE=8 THEN 'CLOSED AND ABORTED'
    WHEN STATE=9 THEN 'CLOSED AND STALE'
    WHEN STATE=10 THEN 'NON-RECOVERABLE'
    ELSE STATE || ''
    END), component_name;
    Thanks,
    Vijay

  • [Win VC++ 6.0 ]How to get the number of files count in a folder using VC++ 6.0?

    Hi all,
    Can any one tell how to get the number of files(.EPS) count inside a folder when the folder path is specified in VC++ 6.0?
    Thanks in Advance.
    Regards
    myriaz

    I'm a little confused by the question, but it sounds like you're asking how to count the number of files with a particular extension in a given directory? That's not really an AI SDK question, but it's a fairly easy one to find if you google it. If you're trying to use Illustrator to do it, AI doesn't have a general purpose file API. It has a few functions to do some things that Illustrator needs, but I don't think enumerating directories is one of them.

  • How to get the string's byte length?

    I have some string,I want to get the string's byte length,how
    can do it?
    for example:
    <cfoutput>#len('hihi,这是测试')#</cfoutput>
    output is 9
    I want to get the byte length is 14, how can i get it?
    Thanks.

    >> Fair cop. I didn't realise that asc() returned the
    codepoint rather than the
    > actual character code.
    >
    > and what would be the difference?
    Oh, sorry, whatever the term is (I'm crap with jargon). The
    value returned
    by asc() for those chars was only two bytes (ie: four hex
    digits). I
    didn't realise there was more to it than that, and that
    2-byte value maps
    to some other THREE byte value. I need to do some reading...
    > that's what both cf & java counted as the length.
    CHARACTER length, sure. No-one's disputing that. On the other
    hand,
    no-one's asking about it, either.
    > by adding a BOM you've already effected the encoding,
    which may or may not
    > match the original. so you still don't know how many
    bytes were in the original
    > string.
    [groan]
    Yes, that's a reasonable strawman there. I was only putting
    it in a file
    so I could save it and check the number of bytes occupied by
    the data.
    Clearly... CLEARLY... the OP is not asking for a character
    length of that
    string. They've said as much.
    I copy and pasted the string from their post, and used it as
    a
    demonstration of how "nine" is not the right answer for the
    BYTE LENGTH of
    that string. Whether or not the original string was UTF-8,
    UTF-16 or
    special-marmoset-encoding, it almost certainly was NOT in a
    fictitious kind
    encoding in which each of those particular characters only
    occupied one
    byte each, which would mean that "nine" is the correct answer
    to the
    question.
    When I copied those characters from either the web browser
    for from my
    text-based news agent, notepad identified them (and rendered
    them
    correctly) as UTF-8, so I'm fairly confident they ARE UTF-8.
    Of course
    this could be down to some intermediary encoding (pasting
    them in to the
    original posting, for example, via some encoding-transforming
    mechanism),
    but Occam's Razor suggests the original question was from a
    UTF-8 POV.
    But maybe we should quit speculating and ask the OP. Unless
    they've
    buggered off in despair of how drawn out all this is getting.
    For which I
    would not blame them.
    Adam

  • How to get the number of days in a month?

    hi all
    is there any way to get the number of days in a given month with a given year? for instance, if year is 2004 and the month is July or February, how can i get the number of days? thanks.

    Gee, I don't know ... Maybe this:
    Calendar cal = Calendar.newInstance();
    cal.set(Calendar.YEAR, 2004);
    cal.set(Calendar.MONTH, Calendar.FEBUARY);
    System.out.println("max days in month: " + cal.getActualMaximum(Calendar.DAY_OF_MONTH));
    Do you not bother reading what people have already posted? Read the API docs on the Calendar class.

  • Date - how to get the number of the week

    I have a Date - string - w/e can be convered thats not the problem
    but how do I get the number of the week cuz the database holds events per week so I need to know the number of the week.
    I tried going true the api but I failed to find the right fuction, aldoh I recall seeing it somewhere a while ago.
    anyways got a deathline so easy dukies, first come first serve.

    how's this then?int weekOfYear = 0;
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); //your String format
    Date date = null;
    String dateString = "2003/06/16";
    try {
      date = sdf.parse(dateString);
    } catch (ParseException pe) {
      //hande bad date format
    if (date != null) {
      GregorianCalendar calendar = new GregorianCalendar();
      calendar.setTime(date);
      weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR);
    Warning: Be careful of your locale settings when using week of year, you may need to investigate setFirstDayOfWeek(int value) and setMinimalDaysInFirstWeek(int value) to ensure you get the results you expect.

  • How to get the number of current active external modes?

    hi all,
    I need to get the number of currently active external modes. This can be done by calling function THUSRINFO. But this only works propperly, if you are logged on only once. If you are logged on more than one time then the function returns several entries in the parameter USR_TABLE. The entries mainly differ in the first parameter TID (type UTID, INT4) "terminal-identification" but how can I know which is the valid one for my current session. Functions TERMINAL_ID_GET, SPH_TERMINAL_IDENTIFY and SPH_TERMINAL_ID_GET dont work.
    Or is there another way to get the number of active external sessions?
    Thanks in advance,
    Michael

    Hi,
    tables: usr02, usr41.
    data: OPCODE_MODE_COUNT(1) TYPE X VALUE 3,
          modes like sy-index,
          u_MODES LIKE MODES.
    select * from usr02.
      select * from usr41 where BNAME = usr02-bname.
        CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_MODE_COUNT
          ID 'TID' FIELD usr41-TERMID
          ID 'MODES' FIELD MODES.
        IF SY-SUBRC = 0.
          u_MODES = u_MODES + MODES.
        ENDIF.
      endselect.
      if sy-subrc = 0.
        write:/ usr02-bname, u_MODES.
      endif.
      clear u_modes.
    endselect.

Maybe you are looking for

  • Cannot Insert Object in Excel 2013

    I am having trouble inserting PDF's in Excel 2013. I go to Insert-->Object-->Create from File then browse to the PDF and select the checkbox for "Display as Icon." After doing this i get a generic error message that says "Cannot Insert Object." No ot

  • R12.1.3 uPGRADE  problem - Help me!!

    i have applied all the 5 patches to my current 12.1.1 environment. 9239089 9239090 9817770 9966055 9239095 I am currently stuck trying to update both database and application layer with the ebs code level 12.1.3 I ran admkappsutil and move appsutil.z

  • The option to Set Breakpoints does not show up when I right-click any step

    Hi All, I am working with a SSIS package and trying to set breakpoints to view the contents of package scoped variables. I am running SQL Server 2008 R2 on Windows Server 2008 R2 and developing in Visual Studio 2008. When I right-click on an Execute

  • Cannot Install Snow Leopard on Macbook Pro 7,1

    Hello guys, I've recently bought a USED Macbook Pro, which has installed Mac O SX Lion (10.7) The thing is I need to install Snow Leopard and I can't do it. I have tried by simply clickin on the Installer Icon and also by booting pressing the key "Op

  • Cannot install flash, using latest version of Firefox

    Hi computer noob here. OS Windows Vista 16b , Browser Firefox V 3.6.23 Im having a couple of problems with adobe at the moment, first of all when I tried to install flash on a friends lap top today it downloaded a DLM , then when thats installed it d