CLN - 1-wire TMEX drivers - calling TMNext - returning pointer memory location

Summary
~~~~~~~~~~~~~~~~~~~~~~
How do I call this function from a Call Library Node?
short far pascal TMNext(
long session_handle,     // session handle for the desired 1-Wire network
void far *state_buffer   // state buffer provided for the 1-Wire network session
Background
~~~~~~~~~~~~~~~~~~~~~~
Hiya,
I searched the forum for 1-wire drivers, but it doesn't seem that there are any. So I thought I'd write some (if I manage it, I'll post them back here) - they'd probably be useful for someone else. They call the functions used by the TMEX 1-wire drivers http://www.maxim-ic.com/products/ibutton/software/tmex/index.cfm
I've managed to get TMExtendedStartSession and TMSetup to work (or, at least, not crash), but I'm struggling to get the TMNext function to work. The problem seems to be getting the correct settings for *state_buffer. This seems to be an array of bytes, dimensions 0 to 15360, but I get a bit baffled by pointers - I think I understand them in principle, but in practice, I usually end up in a bit of a mess!
How to configure?
Numeric or Array? Or adapt to type?
Pointer to Value, Array Data Pointer, etc?
Do I need to dimension a Labview array to 15360 (or 15361) and pass it to the CLN to get the correct array back?
Here is a C example from the support documentation , or I've got a VB example if you'd prefer.
long session_handle;
unsigned char state_buffer[15360];
short result, cnt = 0;
/* session_handle set from a call to TMExtendedStartSession */
/* attempt to find the first device on 1-Wire network */
result = TMFirst(session_handle, state_buffer);
/* loop to count all of the devices on the 1-Wire network */
while (result > 0)
   cnt++;
   /* find next device */
   result = TMNext(session_handle, state_buffer);
/* close the session with a call to TMEndSession */
I'd be very grateful for advice on this - I think if I can get this cracked then CLNs will no longer be the scariest icon on the Labview functions palette.
Many Thanks
Joolz

Hi,
  if I'm understanding this correctly, the state buffer is an array of U8's that gets filled in by this function.
You need to do an initialise array of the U8 type of the appropriate size, and then pass this into the dll at the appropriate parameter.
See the following example code item for a better explanation :
http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_answer=&p_guid=C9914D5A718C627EE034080...
This should work for you, but failing that, you could always wrap it's functionality with a c-based environment, and pass the values to that from LabVIEW< using it as a means of performing the conversion.
Hope that helps
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer

Similar Messages

  • Does mxctrllib provide a call which returns a reference to all the logical names in MAX?

    I'm looking for a call that returns all the MAX logical names on a system. I would populate a drop-down box with those names to allow the user to select a name at program run-time. Currently I hard code a particular logical name as a string and init the session. This is not flexible. Thanks ...

    The NiMxCtrl.dll which is the server for the mxctrllib objects is meant for National Instruments internal product use only. There is no documentation for developing 3rd party apps that utilize its functionality.
    I'm not sure if you are talking about the IVI logical names listed in MAX or not, but if you want to know where you can get a list of these, they are in the ivi.ini file found in your C:\VXIpnp\Win95\niivi directory. Just parse this file to read all of your IVI logical names and setup parameters.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • RFC Call not returning in normal exec;retunrs in debugger

    Hi all
    i m sorry for posting it twice,due to my ignorance
    i first posted it in wrong forum
    i had a requirement to invoke a RFC Async and recieve the results in my program with a condition that the name and parameters of RFC are determined runtime.
    To meet this requirement, i generated a the RFC call and return form code dynamically and called that code from my program via a subroutine.
    The problem i am facing is that, whenever i execute my program in debug mode the RFCs are called and the parameters are returned( perform on end of task edition is used)
    via subroutine, but when i execute the code via F8 the program goes in indefinite wait for return parameters.I am calling 2-3 RFcs at same time, and all of them are on local host.
    the Functions are working well and the RFC destination is also working well.
    But this amalgum of my program and dynamic calls is not going through.
    I read in documentation that if we change the program context or the roll area then the results are not recieved by main program. by the way i am using WAIT to receive the results.
    For the moment if i consider, my program context or roll area is getting changed because of dynamic code generation then also the dynamically generated code is the one containing the RFC call and its revieve subroutine, therefore there shall be no problem with that, the other thought i am getting is that in debugger implict commit work happens, is the program working because of that in debugger?? i dont know....
    Can any one help me with this, in the above long paragraph if anyone gets confused..i can again try to restate my problem.
    One more thing..i have checked the ST22 and SM50 for any abnormalities, couold not find one.
    thanks in advance
    praveen

    WAIT statement also triggers a DB commit like debugger.
    Are you using WAIT UNTIL <condition>?
    Regards
    Sridhar

  • Call and Return

    Hi, hope someone can help.....
    I have constructed an authorware piece that contains severel
    pages(Map icons) sitting on a framework icon.
    I currently have a display icon showing a Page xx of xx Pages
    display on each page. As there is 28 pages this means I have 28 of
    these Icons.
    I have tried to replace these 28 Icons with a single routine
    that is called from each page.
    I have added a new framework icon and called it extras, I
    then use a map Icon called PageStart, inserted several calculation
    and display icons as neccessary. I then use a Navigation Icon set
    to Call and Return to call the PageStart sub-routine. In the
    PageStart map Icon the last Icon is a Navigation Icon set to nearby
    - Exit Framework/Return.
    This does work a treat, however after the sub-routine is
    executed and the jump is made back to the original flowline
    everything contained in the sub-routine is wiped off the face of
    the planet. Just as if I had used an erase Icon.
    Am I doing this right????
    Is there a way to do this????

    "The Pc Doctor" <[email protected]> wrote in
    message
    news:[email protected]...
    > Thanks to you both for your replies...
    >
    >
    First to Mike
    >
    > Pity about the frameworks - I am using several icons to
    calculate the
    > section
    > and page numbers from the positioning of a caluclation
    icon for example
    > Round(SubStr(IconTitle(IconParent(IconID)),2,3)) this
    gives me the page
    > number
    > based on the 2nd and 3rd character of the page title -
    101 How to use this
    > package. I then have a graphical display of which
    sections and pages have
    > been
    > completed - we are talking about a Calc Icon,and a
    couple of Display icons
    >
    > The reason I use this is so that I can drop three icons
    into the flowline
    > of
    > any page at the beginning and dont have to worry about
    changing
    > currentpage or
    > current section numbers. I don't even have to add or
    minus 1 from a
    > variable
    > to display the page number. If I get rid of a page all I
    need to do is to
    > change the page title and everything else is taken care
    of automatically.
    >
    > This is probably all my fault as I'm so used to VB where
    you would put
    > this in
    > a Sub Routine then just call it at the beginning of each
    page. It is no
    > problem just pasting three or four icons into the start
    of each page, I'm
    > just
    > looking for a tidy way to do it.
    >
    > For info I've even tried having the 'StartPage' map icon
    on the main
    > flowline
    > and not in a framework icon. I had to use the GoTo
    command to call then
    > return
    > from the map icon but guess what - that didn't work
    either.
    >
    >
    Next to Amy,
    >
    >
    > Have tried this amy but all I ever get is Page 0 of 20
    Sounds like you forgot to set update displayed variables to
    true on the
    icon.
    > I have even tried using CurentPageNum@"Section1paging" -
    the name of my
    > framework icon, still no joy.
    >
    > Unfortunately to use my code the icon has to be part of
    the actual page
    > itself.
    >
    > Page {Round(SubStr(IconTitle(IconParent(IconID)),2,3))}
    of
    > {Round(ListCount(pagingIconIDs[sectionCurrent]))}
    >
    >
    >
    Again many thanks to you both but it looks as if I will just
    have to
    > settle
    > for having to paste in several repeated icons into each
    page flowline
    We all like doing it the hard way when we're newbies :-). At
    this point in
    Authorware's history, there's probably no point in worrying
    about trying to
    outgrow that phase.

  • How to call a C pointer from call library function node

    I have a client/server application which the client I am trying to develop using Labview.  When I use to communicate the server and the client using the program provided by the manufacter, the system works perfectly.
    Now, I am trying to develop a system using labview, because I need to get another things.
    I have the DLL provided by the manufacter and the .h too, so I can check the functions parameters. One of these functions needs to be called using a struct element. Probably, the function's DLL instantiates the elements of this struct.  I use the call library function node to do it.
    When I receive the data, the function returns to me the struct that I passed as a parameter before, and then I can read all the elements of the struct, except the string element that returns nothing. The struct elements that are numerical, I can read them perfectly.
    Another thing that is important to say, is that the string data was not returned in fact by the DLL function that the system calls. I have to pass a pointer (I use it as unsigned 16 in Labview, but I tried before as string and unsigned 8) as a parameter, and this pointer will point to the memory location that the string is. When I try to read what is returned by the function, I can read nothing. The same function returns that the size of data that is returning is 17 bytes.
    How can I solve it?
    Thank you in advance

    Did you take a look at the example that ships with LabVIEW that shows how to do all sorts of data passing to DLLs. I believe your situation is one of the examples listed. You can find the example VI in the "<LabVIEW install directory>\examples\dll\data passing" directory.

  • WMIProviderException: An error occurred when attempting to connect to the report server remote procedure call (RPC) end point

    I am getting the following error message while trying to configure a database for a Reporting Service Server.  Both SQL Server and Reporting server are 2012 named instances.  I have 2014 instances as well on the same server.
    Exception details...
    Microsoft.ReportingServices.WmiProvider.WMIProviderException: An error occurred when attempting to connect to the report server remote procedure call (RPC) end point. Verify that the Report Server Windows service is running, and then retry the operation.
     ---> System.Runtime.InteropServices.COMException (0x800706B3): The RPC server is not listening. (Exception from HRESULT: 0x800706B3)
       --- End of inner exception stack trace ---
       at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.ThrowOnError(ManagementBaseObject mo)
       at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.GenerateDatabaseScript(String databaseName, Int32 lcid, Boolean isSharePointIntegrated, String& script)
       at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.GenerateDatabaseScript(String databaseName, Int32 lcid, Boolean isSharePointIntegrated, String& script)
    Can someone help me on this please?

    Hi Jaigi,
    According to your description, you want to change a report server database for Reporting Services. But it fails on the last step and returns a error. Right?
    In this scenario, it seems you are creating a report server database on another server via remote connection. Based on the error message, it has issues on executing the script for generating new database. Please check if you have permission to connect the
    server and create a new database. Also please check if the Reporting Services Windows services is working properly.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • CALLING A IMAGE FROM A LOCATION OF SERVER

    Hello to all,i have 2 doubts:
    1ª) try to do this by creating a dummy image and then i format picture and put url{var} where var is in xml element and contains the path of the picture but doesnt work. i'm doing something wrong?
    2º) sometimes i want to call an image without the dummy because i'm limited to the size of the dummy image and if i have pictures in vertical and other in horizontal the aspect isnt quite good. i have a xsl command that i can call an image from a location (contained in a xml element )and resize it at runtime?
    Thank's in advance

    For 1a) what is the code that you are using? Have you followed the process like this blog post: http://blogs.oracle.com/xmlpublisher/2006/05/dynamic_images.html
    Thanks!

  • The \System Root\System32\drivers\NatMotion.sys device could not locate the entry point IoSetDeviceInterfaceState in driver ntoskernal.exe

    After installing version 5.1.1 of the Flexmotion driver, and installing f5 update, I got the following message after rebooting the system: The \System Root\System32\drivers\NatMotion.sys device could not locate the entry point IoSetDeviceInterfaceState in driver ntoskernal.exe. OS is Win NT. I see device in MAX , but can not initialise it, and cannot make firmware update.
    I do not se device from NT system menager.

    The instructions on the f5 update are not 100% explicit about what to do for NT. The NatMotion.sys file should not be replaced on NT systems, only on the specifically listed OSes. Uninstall and reinstall the 5.1.1 driver along with the f5 update, however only install the components that do not specifically mention a particular OS.
    Regards,
    Brent R.
    Applications Engineer
    National Instruments

  • 5800 file called "dl" under phone memory\other\

    By mistake I have just deleted a file called "dl" under "phone memory\other\". What was it for? Is it a problem. How can I regenerate. Factory reset did not work.

    Hi zokman91
    You might find this link of value to you:http://www.allaboutsymbian.com/features/item/How_to_free_up_space_on_disk_C_on_the_Nokia_5800_Xpress...
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • I need an action that did revoke mistakenly called iCloud clear that I locate iphone iphone before that was stolen

    I need an action that did revoke mistakenly called iCloud clear that I locate iphone iphone before that was stolen

    Complain to the Attorney General about what? There is nothing in your story worth any such complaint. They will tell you the same.
    First you have payment difficulty so credit and the Edge program are not available to you. You have to be credit worthy to get any upgrade, unless you can pay full price for all those new devices.
    Can you?
    You are trying to get new contract plans, but since you are having paying on time and in full issues you will not get extended credit from any carrier.
    What I would do is go and port out to Boost or Virgin Mobile where you pay a reduced cost for each device and get unlimited everything for $40 to $50 a month, it is pre pay so if you don't pay you get cut off.
    Verizon although with the best coverage is also the highest priced.
    Good Luck

  • Problem when calling a return type BOOLEAN SQL Function in a package

    Hi All,
    I am having problem when trying to call a SQL function in a package with return type BOOLEAN
    The SQL function signature is as follows
    CREATE OR REPLACE PACKAGE RMSOWNER.ORDER_ATTRIB_SQL ****
    FUNCTION GET_PO_TYPE_DESC(O_error_message IN OUT VARCHAR2,
    I_PO_TYPE       IN     VARCHAR2,
    O_PO_TYPE_DESC  IN OUT VARCHAR2)
    RETURN BOOLEAN;
    Following is my java code
    +CallableStatement cs3 = conn.prepareCall("{?=call ORDER_ATTRIB_SQL.GET_PO_TYPE_DESC(?,?,?)}");+
    +cs3.registerOutParameter(1, java.sql.Types.BOOLEAN);+
    +cs3.registerOutParameter(2, java.sql.Types.VARCHAR);+
    +cs3.registerOutParameter(4, java.sql.Types.VARCHAR);+
    +cs3.setString(2, "");+
    +cs3.setString(3, "ST");+
    +cs3.setString(4, "");+
    +ResultSet rs3 = cs3.executeQuery();+
    I get the following exception, i tried changing the sql type(registerOutParameter) from boolean to bit but i still getting this exception.
    But when i call any other functions with return type other than boolean they work perfectly fine.
    Please can anyone help me fix this issue, i am not sure if its anything to do with vendor JDBC classes?
    +java.sql.SQLException: ORA-06550: line 1, column 13:+
    +PLS-00382: expression is of wrong type+
    +ORA-06550: line 1, column 7:+
    +PL/SQL: Statement ignored+
    +     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)+
    +     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)+
    +     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)+
    +     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)+
    +     at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)+
    +     at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)+
    +     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)+
    +     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316)+
    +     at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3422)+
    +     at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394)+
    #####

    Hello People!
    There is another workaround!!
    See the example below:
    private String callBooleanAPi(String tableName,String apikey,String dtInicio,String dtFim,String comando) throws SQLException {
                   CallableStatement cs = null;
                   String call = "";
                   String retorno = null;
                   try {
                        if(comando.equalsIgnoreCase("INSERT")){
                             call = "declare x BOOLEAN; y varchar2(2);begin x :=PKG.INSERT(?,?,?,?,?); if x then y := 'S'; else y :='N'; end if; ? := y;end;";
                        } else if(comando.equalsIgnoreCase("UPDATE")){
                             call = "declare x BOOLEAN; y varchar2(2);begin x := PKG.UPDATE(?,?,?,?,?); if x then y := 'S'; else y :='N'; end if; ? := y;end;";
                        } else if(comando.equalsIgnoreCase("DELETE")){
                             call = "declare x BOOLEAN; y varchar2(2);begin x := PKG.DELETE(?,?,?,?,?); if x then y := 'S'; else y :='N'; end if; ? := y;end;";
                        cs = conn.prepareCall(call);
                        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
                        SimpleDateFormat sdfToSqlDate = new SimpleDateFormat("yyyy-MM-dd");
                        java.util.Date dataInicialVigencia =null;
                        java.util.Date dataFinalVigencia = null;
                        Date dtInicialFormatada =null;
                        Date dtFinalFormatada = null;
                        if(dtInicio != null && !dtInicio.equals("")){
                             dataInicialVigencia = sdf.parse(dtInicio);
                             dtInicio =sdfToSqlDate.format(dataInicialVigencia);
                             dtInicialFormatada = Date.valueOf(dtInicio);
                        if(dtFim != null && !dtFim.equals("")){
                             dataFinalVigencia = sdf.parse(dtFim);
                             dtFim =sdfToSqlDate.format(dataFinalVigencia);
                             dtFinalFormatada = Date.valueOf(dtFim);
                        cs.setString(1, tableName);
    cs.setString(2, apikey);
    cs.setDate(3, dtInicialFormatada );
    cs.setDate(4, dtFinalFormatada );
    cs.registerOutParameter(5, java.sql.Types.VARCHAR);
    cs.registerOutParameter(6, java.sql.Types.VARCHAR );
    cs.execute();
                        retorno = cs.getString(6);
                        System.out.println( cs.getString(5));
                   } catch(SQLException e){
                   throw new SQLException("An SQL error ocurred while calling the API COR_VIGENCIA: " + e);
                   } catch(Exception e){
                   Debug.logger.error( "Error calculating order: " + id, e );
                   } finally {
                   if (cs != null) {
                   cs.close();
                   cs = null;
                   return retorno;
    As you can see the CallableStatement class acepts PL/SQl blocks.
    Best Regards.

  • How to know that a method has been called and returning value of a method

    Hi, everyone! I have two questions. One is about making judgment about whether a method has been called or not; another one is about how to return "String value+newline character+String value" with a return statement.
    Here are the two original problems that I tried to solve.
    Write a class definition of a class named 'Value' with the following:
    a boolean instance variable named 'modified', initialized to false
    an integer instance variable named 'val'
    a constructor accepting a single paramter whose value is assigned to the instance variable 'val'
    a method 'getVal' that returns the current value of the instance variable 'val'
    a method 'setVal' that accepts a single parameter, assigns its value to 'val', and sets the 'modified' instance variable to true, and
    a boolean method, 'wasModified' that returns true if setVal was ever called.
    And I wrote my code this way:
    public class Value
    boolean modified=false;
    int val;
    public Value(int x)
    {val=x;}
      public int getVal()
      {return val;}
       public void setVal(int y)
        val = y;
        modified = true;
         public boolean wasModified()
          if(val==y&&modified==true)
          return true;
    }I tried to let the "wasModified" method know that the "setVal" has been called by writing:
    if(val==y&&modified==true)
    or
    if(x.setVal(y))
    I supposed that only when the "setVal" is called, the "modified" variable will be true(it's false by default) and val=y, don't either of this two conditions can prove that the method "setVal" has been called?
    I also have some questions about the feedback I got
    class Value is public, should be declared in a file named Value.java
    public class Value
    cannot find symbol
    symbol  : variable y
    location: class Value
    if(val==y&&modified==true)
    *^*
    *2 errors*
    I gave the class a name Value, doesn't that mean the class has been declared in a file named Value.java*?
    I have declared the variable y, why the compiler cann't find it? is it because y has been out of scale?
    The other problem is:
    Write a class named  Book containing:
    Two instance variables named  title and  author of type String.
    A constructor that accepts two String parameters. The value of the first is used to initialize the value of  title and the value of the second is used to initialize  author .
    A method named  toString that accepts no parameters.  toString returns a String consisting of the value of  title , followed by a newline character, followed by the value of  author .
    And this is my response:
    public class Book
    String title;
    String author;
      public Book(String x, String y)
       { title=x; author=y; }
       public String toString()
       {return title;
        return author;
    }I want to know that is it ok to have two return statements in a single method? Because when I add the return author; to the method toString, the compiler returns a complain which says it's an unreachable statement.
    Thank you very much!

    Lets take this slow and easy. First of all, you need to learn how to format your code for readability. Read and take to heart
    {color:0000ff}http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html{color}
    Now as to your first exercise, most of it is OK but not this:   public boolean wasModified()
          if (val == y && modified == true)
                return true;
    y being a parmeter to the setValue method exists only within the scope of that method. And why would you want to test that anyways? If modified evaluates to true, that's all you need to know that the value has been modified. So you could have   public boolean wasModified()
          if (modified == true)
                return true;
       }But even that is unnecessarily verbose, as the if condition evaluates to true, and the same is returned. So in the final analysis, all you need is   public boolean wasModified()
          return modified;
       }And a public class has to be declared in a file named for the class, yes.
    As for your second assignment, NO you cannot "return" two variables fom a method. return means just that: when the return statement is encountered, control returns to the calling routine. That's why the compiler is complaining that the statement following the (first) return statement is unreachable.
    Do you know how to string Strings together? (it's called concatenation.) And how to represent a newline in a String literal?
    db

  • Explicit template member function call from return value of function

    i couldn't see this in the list of C++ standards not implemented <http://developers.sun.com/tools/cc/documentation/ss9_docs/mr/READMEs/c++.html> but sun studio 9 doesn't seem to allow explicit calls to template member functions where the left-hand-side is the return value of a function. here's a test-case:
    template <typename T> class Ptr {
    public:
      T* p_;
      Ptr(T* p) : p_(p) { }
      template <typename U> Ptr(const Ptr<U>& u) : p_(u.p_) { }
      template <typename U> Ptr<U> cast() const { return Ptr<U>(*this); }
    class A {
    class B : public A {
    Ptr<A> test_cast_1(const Ptr<B>& b) { return b.cast<A>(); }
    Ptr<A> test_cast_2(const Ptr<B>& b) { return Ptr<B>(b).cast<A>(); }sun studio 9 CC complains with the following message:
    "sunstudio9-template-explicit-call.cc", line 18: Error: Unexpected type name "A" encountered.
    "sunstudio9-template-explicit-call.cc", line 18: Error: Operand expected instead of ")".
    2 Error(s) detected.
    (line 18 is test_cast_2)
    is this a known bug?
    cheers,
    /lib

    you omitted the required keyword template:
    template <typename T> class Ptr {
    public:
      T* p_;
      Ptr(T* p) : p_(p) { }
      template <typename U> Ptr(const Ptr<U>& u) : p_(u.p_) { }
      template <typename U> Ptr<U> cast() const { return Ptr<U>(*this); }
    class A {
    class B : public A {
    Ptr<A> test_cast_1(const Ptr<B>& b) { return b.cast<A>(); }
    Ptr<A> test_cast_2(const Ptr<B>& b) { return Ptr<B>(b).template cast<A>(); }

  • Direct Telephone Number to Call to Return ActionTec DSL Wireless Router Modem

    The Verizon repairman repaired  problem with our new ADT alarm interfering with our DSL internet connection.  However, connection is very slow (like dial-up).  He said we need to replace our Actiontec DSL Wireless Router Modem because it is "dropping packets".  What is the direct phone number at Verizon to call to get info on how to return the modem and get a new one?  We own the modem (bought it 2 years ago from Verizon).

    gfevrier wrote:
    The Verizon repairman repaired  problem with our new ADT alarm interfering with our DSL internet connection.  However, connection is very slow (like dial-up).  He said we need to replace our Actiontec DSL Wireless Router Modem because it is "dropping packets".  What is the direct phone number at Verizon to call to get info on how to return the modem and get a new one?  We own the modem (bought it 2 years ago from Verizon).
    I recommend calling 800-567-6789 and I believe it's option 1 for tech support, and option 1 for Windows, and option 1 for High Speed Internet (HSI).
    A Verizon Online tech support consultant should be able to place an order to drop ship replacement equipment. I am unaware of any potential charge to do so. I believe with HSI modems and routers have a one year warranty under which Verizon will absorb the cost of a replacement.
    Thank you,
    -Harles

  • IDispatchMessageInspector.AfterReceiveRequest - bypass service call and return manually response

    Hi,
    I am using a service behavior class that implements IDispatchMessageInspector.AfterReceiveRequest to handle Health Check Service request that require skipping the actual operation's code and instead manually crafting a response message from "BeforeSendReply".
    I want to skip any processing on the request and instead want to return manual response from "BeforeSendReply".
    It has been pointed out in various forum threads that setting ref request parameter to null will skip the normal message processing and transition directly to BeforeSendReply. I have tracing enabled on my service and observe that underneath it still tries to
    deserialize the message and throws an exception:
    NullReferenceException: Object reference not set to an instance of an object.
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    any idea how can I skip the service call and instead return a manual response back?
       

    This is not correct (setting request to null to bypass the service), unfortunately WCF doesn't have any out-of-the-box way of doing that.
    You can, however, use a few more of the extensibility points in WCF to make this scenario work. You'll need at least an IDispatchMessageFormatter (to prevent the message from being read / deserialized since it's not necessary) and an IOperationInvoker (to
    actually bypass invoking the service method). You can use the operation context to pass information between those extensibility points.
    You can find more information about those three interfaces in my ongoing blog series about WCF extensibility points:
    IDispatchMessageInspector: http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx
    IDispatchMessageFormatter: http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/03/wcf-extensibility-message-formatters.aspx
    IOperationInvoker: http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/17/wcf-extensibility-ioperationinvoker.aspx
    The code which uses those extensions to skip the operation based on a decision made in the message inspector:
    public class Post_55ef7692_25dc_4ece_9dde_9981c417c94a
    [ServiceContract(Name = "ITest", Namespace = "http://tempuri.org/")]
    public interface ITest
    [OperationContract]
    string Echo(string text);
    public class Service : ITest
    public string Echo(string text)
    return text;
    static Binding GetBinding()
    BasicHttpBinding result = new BasicHttpBinding();
    return result;
    public class MyOperationBypasser : IEndpointBehavior, IOperationBehavior
    internal const string SkipServerMessageProperty = "SkipServer";
    public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new MyInspector(endpoint));
    public void Validate(ServiceEndpoint endpoint)
    public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
    public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
    dispatchOperation.Formatter = new MyFormatter(dispatchOperation.Formatter);
    dispatchOperation.Invoker = new MyInvoker(dispatchOperation.Invoker);
    public void Validate(OperationDescription operationDescription)
    class MyInspector : IDispatchMessageInspector
    ServiceEndpoint endpoint;
    public MyInspector(ServiceEndpoint endpoint)
    this.endpoint = endpoint;
    public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
    Message result = null;
    HttpRequestMessageProperty reqProp = null;
    if (request.Properties.ContainsKey(HttpRequestMessageProperty.Name))
    reqProp = request.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
    if (reqProp != null)
    string bypassServer = reqProp.Headers["X-BypassServer"];
    if (!string.IsNullOrEmpty(bypassServer))
    result = Message.CreateMessage(request.Version, this.FindReplyAction(request.Headers.Action), new OverrideBodyWriter(bypassServer));
    return result;
    public void BeforeSendReply(ref Message reply, object correlationState)
    Message newResult = correlationState as Message;
    if (newResult != null)
    reply = newResult;
    private string FindReplyAction(string requestAction)
    foreach (var operation in this.endpoint.Contract.Operations)
    if (operation.Messages[0].Action == requestAction)
    return operation.Messages[1].Action;
    return null;
    class OverrideBodyWriter : BodyWriter
    string bypassServerHeader;
    public OverrideBodyWriter(string bypassServerHeader)
    : base(true)
    this.bypassServerHeader = bypassServerHeader;
    protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
    writer.WriteStartElement("EchoResponse", "http://tempuri.org/");
    writer.WriteStartElement("EchoResult");
    writer.WriteString(this.bypassServerHeader);
    writer.WriteEndElement();
    writer.WriteEndElement();
    class MyFormatter : IDispatchMessageFormatter
    IDispatchMessageFormatter originalFormatter;
    public MyFormatter(IDispatchMessageFormatter originalFormatter)
    this.originalFormatter = originalFormatter;
    public void DeserializeRequest(Message message, object[] parameters)
    if (message.Properties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    Message returnMessage = message.Properties[MyOperationBypasser.SkipServerMessageProperty] as Message;
    OperationContext.Current.IncomingMessageProperties.Add(MyOperationBypasser.SkipServerMessageProperty, returnMessage);
    OperationContext.Current.OutgoingMessageProperties.Add(MyOperationBypasser.SkipServerMessageProperty, returnMessage);
    else
    this.originalFormatter.DeserializeRequest(message, parameters);
    public Message SerializeReply(MessageVersion messageVersion, object[] parameters, object result)
    if (OperationContext.Current.OutgoingMessageProperties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    return null;
    else
    return this.originalFormatter.SerializeReply(messageVersion, parameters, result);
    class MyInvoker : IOperationInvoker
    IOperationInvoker originalInvoker;
    public MyInvoker(IOperationInvoker originalInvoker)
    if (!originalInvoker.IsSynchronous)
    throw new NotSupportedException("This implementation only supports synchronous invokers");
    this.originalInvoker = originalInvoker;
    public object[] AllocateInputs()
    return this.originalInvoker.AllocateInputs();
    public object Invoke(object instance, object[] inputs, out object[] outputs)
    if (OperationContext.Current.IncomingMessageProperties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    outputs = null;
    return null; // message is stored in the context
    else
    return this.originalInvoker.Invoke(instance, inputs, out outputs);
    public IAsyncResult InvokeBegin(object instance, object[] inputs, AsyncCallback callback, object state)
    throw new NotSupportedException();
    public object InvokeEnd(object instance, out object[] outputs, IAsyncResult result)
    throw new NotSupportedException();
    public bool IsSynchronous
    get { return true; }
    public static void Test()
    string baseAddress = "http://" + Environment.MachineName + ":8000/Service";
    ServiceHost host = new ServiceHost(typeof(Service), new Uri(baseAddress));
    ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(ITest), GetBinding(), "");
    endpoint.Behaviors.Add(new MyOperationBypasser());
    foreach (var operation in endpoint.Contract.Operations)
    operation.Behaviors.Add(new MyOperationBypasser());
    host.Open();
    Console.WriteLine("Host opened");
    ChannelFactory<ITest> factory = new ChannelFactory<ITest>(GetBinding(), new EndpointAddress(baseAddress));
    ITest proxy = factory.CreateChannel();
    Console.WriteLine(proxy.Echo("Hello"));
    Console.WriteLine("And now with the bypass header");
    using (new OperationContextScope((IContextChannel)proxy))
    HttpRequestMessageProperty httpRequestProp = new HttpRequestMessageProperty();
    httpRequestProp.Headers.Add("X-BypassServer", "This message will not reach the service operation");
    OperationContext.Current.OutgoingMessageProperties.Add(
    HttpRequestMessageProperty.Name,
    httpRequestProp);
    Console.WriteLine(proxy.Echo("Hello"));
    ((IClientChannel)proxy).Close();
    factory.Close();
    Console.Write("Press ENTER to close the host");
    Console.ReadLine();
    host.Close();

Maybe you are looking for

  • Garbage Characters in XML Feed

    I have a presentation template that produces an XML RSS feed. Although I tell it to use UTF-8 like this : <?xml version="1.0" encoding="UTF-8"?> I still see garbage characters in the news feed. I've read that XML still has trouble dealing with certai

  • Iphone 3G stuck in recovery mode loop

    okay...i'm sure there a lot of topics on this, but i can't find anything is fixing the issue. i traded my 32gb ipod for a 16gb iphone 3G. i traded it mainly because i wanted to unlock it to t-mobile. i wanted to updated it to ios4 so i wouldn't have

  • I lst my ipod id it possible to find it by serial key

    i lost my ipod a while back and ive been looking for it its in the house for sure. and the battery is probably dead is there a way to track it with the serial key. i did not get to set up find my iphone with it.

  • Query list on particular customer table

    Dear gurus I want to know queries(or inforset) which are used by particular customer table. Do you have any idea? I thought that I can know via SE11's "where-used list" function, but it seems that query is not included in this function. BR Y.Kaneko

  • Ram for Early 2011 Macbook Pro

    What is the maximum RAM I can install in my MacBook Pro. Depending on where I look it is either 2 x 4 Gig (8 Gig) or 2 x 8 Gig (16 Gig)