Results 1 to 8 of 8

Thread: Can I use VB.NET to interface to a fruit machine hopper?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2017
    Posts
    3

    Can I use VB.NET to interface to a fruit machine hopper?

    Hi all,

    This might be a strange question so please bear with me. Firstly, I have never programmed in VB before (I have programmed web languages like PHP, SQL etc so I do have a bit of experience of programming).

    I planning on building a fruit machine that will use MFME (this is some fruit machine emulation software). I would like to give my fruit machine the ability to "pay out" real coins.

    In order to do this I've ordered a "hopper" (basically a motorised coin bucket that dispenses coins) and a hopper interface card.

    The interface card comes with some software that, when you run it with command line parameters, it instructs the hopper to pay out that number of coins (eg. cash.exe 1 5 - this would tell hopper 1 to pay out 5 coins).

    So far ... so good.

    Each 'fruit machine' has .gam files that look like this...

    Code:
    System MPU5
    DIP 1 00000000
    DIP 2 00000000
    Delay 2500000
    Stake 3
    Jackpot 3
    Percentage 9
    SetPercent 88
    TotalIn 1930
    TotalOut 1620
    Played 39
    Layout Eliminator_1600_DX.dat
    ROM rom.hex
    Basically I would like a small program that starts with windows and just sits there constantly reading every .gam file in a folder and, if the "TotalOut" changes, it would send the write value to "cash.exe".

    So.... my questions are.....

    1) Is this something that can easily be done in VB.NET or should I be using something else for this?

    2) Bearing in mind I'm a beginner to the language (albeit with a tiny bit of programming experience) is this a very complicated program to write?

    Thanks for reading all this and a big thanks for any help you can give me.

    Cheers :-)

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    You can certainly do what you want with VB. It doesn't sound especially complex, but there will be a but to learn for a rank beginner.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2017
    Posts
    3

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    Quote Originally Posted by jmcilhinney View Post
    You can certainly do what you want with VB. It doesn't sound especially complex, but there will be a but to learn for a rank beginner.
    Okay, thanks for the info. I'm assuming I'm in the right place for help though! :-)

    **EDIT** I'm currently downloading Visual Studio Community and watching YouTube videos and I've found a good tutorial on the web.

    Thanks :-)
    Last edited by uptown47; May 28th, 2017 at 06:02 AM.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,043

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    I realize it's a serious question, and rather an interesting one, but I'm having a hard time not laughing at it. The very fact that you mention "fruit machine emulation software" kind of cracks me up.

    It really does sound like the problem is one that .NET is well suited for, though. However, there are a few clues in what you wrote that make me think that you might either explain a couple points in more detail, or investigate them in more detail. For one thing, you talk about a command line. This suggests that there is a communication protocol between the computer and the device. Most likely you can get at this directly using something like serial communication (less likely either TCP or UDP, though those would be even easier in the long run), or via an API. If ANY of those are available, you'll be able to do something far richer, and that would be good.

    You also mention .gam files. You might look into the FileSystemWatcher (I think that's the name), as that may prove to be useful.

    Lastly, if this is a real coin bucket, it seems like there ought to be some kind of security involved. Perhaps the security comes from the fact that nobody has physical access to the interface, but it seems like at least something ought to be there.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2017
    Posts
    3

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    Quote Originally Posted by Shaggy Hiker View Post
    I realize it's a serious question, and rather an interesting one, but I'm having a hard time not laughing at it. The very fact that you mention "fruit machine emulation software" kind of cracks me up.

    It really does sound like the problem is one that .NET is well suited for, though. However, there are a few clues in what you wrote that make me think that you might either explain a couple points in more detail, or investigate them in more detail. For one thing, you talk about a command line. This suggests that there is a communication protocol between the computer and the device. Most likely you can get at this directly using something like serial communication (less likely either TCP or UDP, though those would be even easier in the long run), or via an API. If ANY of those are available, you'll be able to do something far richer, and that would be good.

    You also mention .gam files. You might look into the FileSystemWatcher (I think that's the name), as that may prove to be useful.

    Lastly, if this is a real coin bucket, it seems like there ought to be some kind of security involved. Perhaps the security comes from the fact that nobody has physical access to the interface, but it seems like at least something ought to be there.
    Hi there SH,

    Thanks for the reply.

    The "command line" bit is a DLL that the guy who developed the hopper interface board made. Basically he ships a small executable with the board and to run the board you just execute his software and pass a parameter of how many coins you want the hopper to eject.

    My software would read the amount needed to pay (e.g. £2) - call cash.exe and pass 2 as a parameter - this then talks to the hopper interface via USB and the hopper interface board is connected to the actual hopper and the hopper would then pass out 2 coins.

    I'll look up FileSystemWatcher as I've not heard of that. I've just spent the afternoon playing with Visual Studio and watching YouTube videos. I'm just past the "hello world" example!! :-)

    It is a 'real' coin bucket but it's just going to be a machine in my house for myself and some of mates to play on (if they wanted to). It'll basically be a fancy moneybox so I'm not too worried about security. Obviously if someone was to break in to my house then they could get at it but then a £100 or so would probably be the least of my worries!

    The .gam file has a variable that stores the state of the "machine" that the emulator runs. One of the variables is called "TotalOut" this increments when you press "collect" on the emulated fruit machine.

    Basically I want a program that will run on Windows start up, loop through all the .gam files in the folder, record the value of each "TotalOut" variable, then sit and listen for the "C" key to be pressed (C is the 'collect' key on the emulator). When the "C" key is pressed, I want to loop through the files again and compare the "TotalOut" variables with the first values and check if any have increased. If they have then send that value to the "cash.exe" file that talks to the hopper interface. Then update all the values again to wait for the next time "C" is pressed.

    Thanks again for any help / advice / code tips / etc you can give me. It is much appreciated :-)

  6. #6
    New Member
    Join Date
    Dec 2017
    Posts
    2

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    Hi Uptown47,
    I am a newbie in vbnet, i have the same project of you, i have build a cabinet and installed mfme 6 with a pac drive and led and all is ok. i have a hopper and the same cash interface of you. can you help me for the vb net program.
    thank you for your answer and sorry for my bad english.

    Eric

  7. #7
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    You guys are ensuring your homemade slot machines comply with all local gambling laws and ordinances, right?
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  8. #8
    New Member
    Join Date
    Dec 2017
    Posts
    2

    Re: Can I use VB.NET to interface to a fruit machine hopper?

    Yes of course

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width