03-27-2017 05:04 AM
Hi,
I want to create a simulator, which checks the request msg received from other devices via serial port and based on the request simulator should response msg.
For example:
Other Device Request to my simulator : 2B 2B 2B
My Simulator Response : 65 6E 74 72 61 4E 45 54 3E 20
Also, there are series of request message send sequentially to the simulator and after response is sent by simulator for each request - login successful.
Any heads up on how to proceed is highly appreciated.
Thanks
Solved! Go to Solution.
03-27-2017 06:32 AM
I would recommend a sort of state machine. Each step in the state machine is to look for the message. Do you have a better description of the full message protocol?
03-27-2017 09:48 AM
Hi Crossrulz,
It is a serial data protocol and data are in ASCII format.
Can you post a simple vi if possible for my better understanding, so that i can take it up from there.
Thanks
Aniket
03-27-2017 10:32 AM
aniketjha wrote:
It is a serial data protocol and data are in ASCII format.
That is a start. Do the messages you receive end with a termination character (typically a Line Feed, 0xA, \n)?
03-27-2017 10:43 AM
Yes, it ends with termination character...
03-27-2017 01:57 PM - edited 03-27-2017 02:03 PM
I originally wrote this for a nugget series that I have been working on here in there. Should at least get you started.
03-28-2017 12:03 AM
Thanks Crossrulz, this will work.
I will let you know once i done with the vi.
03-28-2017 04:53 AM
Hi Crossrulz,
1 simple doubt i have and it is not related to this topic, is there any way i can provide enable/disable button to create/clear communication loss via serial port.
Sorry for pulling up this simple question in this thread.
Thanks
Aniket
03-28-2017 06:34 AM
You can use a State Machine with states like "Connect", "Read", "Close", etc. So when you detect a connection loss, you can go back to the Connect state or an idle state waiting for somebody to press a button to reconnect.
03-28-2017 07:19 AM
I am actually new to this Crossrulz, if i get some sample vi on state machines particular to my requirement i will pick it up from there.
Aniket