New Life Games LLC
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News:

Welcome to the NewLifeGames.com message forum! 

 


NLG Site Navigation Menu


Archives of old posts can be found at...... Newlifegames.net/nlg/

Author Topic: W10 / Python doubts with the 9bits communication  (Read 1955 times)

0 Members and 1 Guest are viewing this topic.

Offline tcv

  • New NLG Member 3 to 100 Posts
  • **
  • Posts: 4
  • Reputation Power: 0
  • tcv New User has no influence.
  • Gender: Male
  • NLG
W10 / Python doubts with the 9bits communication
« on: August 14, 2020, 04:17:12 AM »
  Hi all


I have some doubts with the 9bits communication


I am experimenting with a SAS HOST application that I am developing in Python language from windows10
The application starts with a thread that sends every 200ms 0x81 and 0x80

0x81 = (0x80 + EGM address) with MARK parity
0x80 with EVEN parity

To send a command, the application pauses the thread
and first sends the 0x80 command, does a 200ms sleep and then sends the 0x11 command, after receiving a response
I resume thread 0x81 / 0x80.

This works perfectly, even with other 0x12, 0x18, 0x0F commands. However other commands do not return data, for example 0x1C, 0x1F.

I have been able to verify with the IGT SAStest application that all these commands respond correctly, therefore it is clear that I must be doing something wrong in my application

This happens on some machines, on others if they return response from those commands.As I have been able to read some post, some machines do not verify parity, so it is possible that if they respond to those commands
I do not know if it will be a matter of General Polls times(200ms) or the combination of parity change Mark to Even.

I appreciate any input or help on this topic because so far I have not gotten those commands to work


Thank you very much for your help

Offline iwalker

  • Sr NLG Member
  • New NLG Member 3 to 100 Posts
  • *
  • Posts: 89
  • Reputation Power: 8
  • iwalker New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #1 on: August 15, 2020, 08:32:52 AM »
Hi TCW welcome to NLG


For arduino microcontroller my code for a general poll is as follows.
As far as i can recall if there has to be a small delay between 0x80 and 0x81 hence th 20ms delay.
Your 0x80 should be space parity not even (Ie 9th bit always zero)
If you are testing on a IGT its useful to go into diagnostics and do comms test to see if your SAS comms is coming through as expected.
Code: [Select]

void GeneralPoll()//


{


  SASEvent[0]= 0x00;
 
  UCSR1B = 0b10011101;
  Serial1.write(0x80);
  delay(20);
  Serial1.write(0x81); 
  UCSR1B = 0b10011100;
 
  Serial1.readBytes(SASEvent,sizeof(SASEvent));


}



 

Offline tcv

  • New NLG Member 3 to 100 Posts
  • **
  • Posts: 4
  • Reputation Power: 0
  • tcv New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #2 on: August 16, 2020, 02:33:49 PM »
Hi iwalker

With arduino I have tried with this method that you use and it works correctly, but I would like to achieve it for the Python application that I am developing.

I have also tried with IGT SAS Test software, it Works perfectly.

The surprising thing is that this machine responds to commands, for example 0x1C or 0x1F  from the SAS TEST but does not respond from my Python application.
However with other commands such as 0x11, 0x12, 0x0F it responds without major problem from my application.

I understand that it is a timing issue, but I also use 20ms to the 80/81 cycle and 5ms inter-byte for Long Polls.
I'm not really sure, but maybe the Mark / Even change causes unwanted delays.

In my case it only works if the cycle 80/81 I configure it with Mark parity, and Even to send the bytes of the command that I request.

As I have been able to find out, there are DLL, not free, that are used for this type of communication.
If my application were for commercial purposes I would have no problem paying, but this is a job by learning and entertaining.

Regards

Offline iwalker

  • Sr NLG Member
  • New NLG Member 3 to 100 Posts
  • *
  • Posts: 89
  • Reputation Power: 8
  • iwalker New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #3 on: August 17, 2020, 10:18:30 AM »

Offline tcv

  • New NLG Member 3 to 100 Posts
  • **
  • Posts: 4
  • Reputation Power: 0
  • tcv New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #4 on: August 17, 2020, 10:57:55 AM »
Hello iwalker

Thanks a lot for your help, but I've already been looking at the pyserial documentation.

That's where I found a way to change the Mark / Even parity on the program flow without needing to close / open the com port

See the extract with sync 80/81 with a time (self.gp = 20ms.)





        self.connection.parity = serial.PARITY_MARK
        self.connection.write([0x80])
        time.sleep(self.gp)
        self.connection.write([0x81])
        time.sleep(self.gp)
        self.connection.parity = serial.PARITY_EVEN   
       #------------------- 

Regards

Offline iwalker

  • Sr NLG Member
  • New NLG Member 3 to 100 Posts
  • *
  • Posts: 89
  • Reputation Power: 8
  • iwalker New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #5 on: August 17, 2020, 05:05:28 PM »
Hello TVC


self.connection.parity = serial.PARITY_EVEN  should be self.connection.parity = serial.PARITY_SPACE


I think whats happening is this - Your commands that are working have an even parity so for those bit 9 is zero.
Commands that are not working have odd parity so bit 9 is 1 and so mahine thinks it is being addressed.
« Last Edit: August 18, 2020, 01:19:49 AM by iwalker »

Offline tcv

  • New NLG Member 3 to 100 Posts
  • **
  • Posts: 4
  • Reputation Power: 0
  • tcv New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #6 on: August 17, 2020, 06:17:07 PM »
Hi iwalker
What do you suggest, that I send those commands that don't work setting to odd parity?

I can prove it

As soon as I do the test I will report the result

Thank you

Offline iwalker

  • Sr NLG Member
  • New NLG Member 3 to 100 Posts
  • *
  • Posts: 89
  • Reputation Power: 8
  • iwalker New User has no influence.
  • Gender: Male
  • NLG
Re: W10 / Python doubts with the 9bits communication
« Reply #7 on: August 18, 2020, 11:24:00 AM »
The suggestion is to use space parity - sorry this got lost on previous post due to font size - fixed

Offline jay

  • Global NLG Site Moderator
  • NLG Member 501 to 10,000 Posts
  • *
  • Posts: 2124
  • Reputation Power: 164
  • jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!jay Is an-NLG GOD!
  • Gender: Male
  • The only way to beat the casino is to own it.
Re: W10 / Python doubts with the 9bits communication
« Reply #8 on: August 18, 2020, 03:15:20 PM »
Could you not tri-send commands Odd, Even, Space … counting on one to execute. You could kill the attempt sequence once you get back a success response.
If you can't afford to lose you can't afford to win.

If you find this site helpful, please consider making a small donation to help defray the cost of hosting and bandwidth.

Please do not PM me for support or "how to" requests -- please post your request in the forum so that everyone may assist you and everyone can benefit from the answer to your question!  Thanks! :)

 

Cell Phone and Pad Mode

imode wap wap2

NLG Archives

Archives @ newlifegames.net Wayback Machine

Contact Us

NLG Shop 928 754-4147 Email Us 1788 Highway 95 30 BHC City AZ 86442
If you find this site helpful, please consider becoming a Contributing NLG Member with a monthly subscription to help cover the cost of pizza, coffee, aspirin, hosting, and bandwidth.
Contributing Members: get unlimited personal messages, can save topics and replies as drafts,
can post to the Classified ads, get unlimited access to the downloads, and also get this minty badge:



**Subscription Link** (Click Here) **Subscription Link**



           
If you would rather remain anonymous Thank You or just want to help support the site, please use this "make a donation" button:




From your entire NLG staff, thank you for supporting NLG.


New Life Games LLC 1788 HIGHWAY 95 UNIT 30 BULLHEAD CITY AZ 86442




Newlifegames.com     Newlifegames.net     Newlifegames.org

Newlifegame.com     Newlifegame.net     Newlifegame.org    Newlifegames.us

   New Life Games     NewLifeGames  NLG

 We Bring new Life to old Games    1-888-NLG-SLOTS

Are all Copyright and Trademarks of New Life Games LLC 1992 - 2022


FAIR USE NOTICE:



This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner.
We make such material available in an effort to advance awareness and understanding of the issues involved.
We believe this constitutes a fair use of any such copyrighted material as provided for in section 107 of the US Copyright Law.
In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those
who have expressed a prior interest in receiving the included information for research and educational purposes.

For more information please visit: http://www.law.cornell.edu/uscode/17/107.shtml
If you wish to use copyrighted material from this site for purposes of your own that go beyond fair use,
you must obtain permission directly from the copyright owner.




The NewLifeGames.com website is optimized for use with Firefox and a minimum screen resolution of 1600 x 900 pixels.

SimplePortal 2.3.5 © 2008-2012, SimplePortal