From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET Write within a state machine

I have a state machine in which I write to my controller in one of the states...the very first time the state writes perfect but when it comes to loop back into that state the state - it doesn't write... I don't get an error, and I can see that I have the right session, my bit just isn't changing... is there anything special I need to do to constantly  write to this command?

0 Kudos
Message 1 of 5
(3,209 Views)

Could you attach the code to which you are referring?  It is difficult to understand the possible issue without seeing how you have written the code.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 2 of 5
(3,132 Views)

Having an idea of what the code looks like is definitely helpful. Without it I can suggest the following:

  • Since we know the state machine works properly through the first execution we can verify that the 2nd execution passes through the same states in the same order. For example, if the first execution traverses A - B - C - D, make sure that the 2nd pass isn't skipping a state like A - C - D. etc.
  • Once the states have been verified, check to ensure the inputs aren't affected by state. For example make sure that the inputs for A1 match the inputs for A2, B1 matches B2 ect. 

 

 

Jeff L
National Instruments
0 Kudos
Message 3 of 5
(3,126 Views)

Maybe enable Echo Transmitted Frames for the hardware, and then on the read, see if the hardware believes the message went out.  Providing the code would help.  Also it is odd no error is generated are you sure there isn't one?

0 Kudos
Message 4 of 5
(3,092 Views)

Not knowing your code:

Make sure that you are not re-initializing the interface (Opening/Connecting) without first Disconnecting or Closing it first.  It will try to create a new connection and won't work.  Initialize, Open, and Connect prior to your loop, then read/write the results based on your loop.  When exiting the loop, you will then Disconnect and Close.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 5 of 5
(3,071 Views)