Troubleshooting Challenges in Developing a Simon Says Game using PLC Technology

Question:

Greetings everyone! As a newcomer to plc programming, I have discovered this forum and am eager to tap into the wealth of resources available here. Currently, I am immersed in developing a Simon Says game using plc technology. While I have successfully generated code to mimic a complete game, I am facing a couple of challenges. Firstly, the game sequences lack randomness as I have manually crafted them through drums. Secondly, the game fails to identify when a player enters an incorrect response within a given sequence. These obstacles have stumped me, and I am seeking assistance. If anyone could review my code or provide guidance on this project, I would be immensely grateful. Simon Says.ckp.

Top Replies

A more effective approach would be to include the .ckp file in your post rather than sharing a link to an unreadable document. For better search results, use Google to search the forum by entering: [simon says] [Search].

For this task, a Linear Congruential Generator is sufficient and there is no need for a high-quality random number generator. Consider looking up information on Linear Congruential Generator for your needs.

During my time in maintenance tech school, I developed a Simple Simon game using a bit sequencer and Excel to generate raw data. This data was then written into a PLC using a DDE link, creating a list of 256 elements within a single file. To initiate a new game, the free running clock was used to determine a starting index in the file by dividing it by 256. If you need to upload a Click PLC file, be sure to ZIP it first to comply with the forum's file attachment limitations. Zip folders are permitted and can accommodate various file types.

The formula for a primitive random number generator that does not follow a normal distribution and has a biased mode is as follows: x := a*x* (1 - x) where 3.9 < a < 4.

I created a reversed variation where users can press multiple buttons in a random sequence, and the Programmable Logic Controller (PLC) will mimic their actions. This interactive feature is perfect for when you're looking for a fun way to pass time.

Welcome to the forum! It's great to hear that you're using PLC programming to create a Simon Says game. Regarding your challenges, you may want to introduce random function blocks in your code to randomize the game sequences. As for the incorrect response identification, consider comparing player's input with the correct sequence in real-time or after each round. A Mismatch error can be thrown whenever the input strays from the correct sequence. Please feel free to post your current code if you're comfortable with that. Many eyes can help to spot the issues faster. Look forward to seeing your progress!

Hey, welcome to the world of PLC programming! Firstly, implementing randomness in PLCs can be a bit tricky due to their deterministic nature. You might want to play around with using the TIMER or COUNTER pulses as a random seed - each TICK, TOCK cycle is slightly variant and could be exploited for your purpose. For the second issue, double-check your sequence comparison logic. Maybe the sequence check isn't resetting properly or there's an issue in your state transitions whenever a wrong response is detected. Don't be discouraged, these issues would baffle many beginners. Share more details about your code if you can, we're here to help!

Welcome to the world of PLC programming! The Simon Says game sounds like a fantastic project. Regarding your challenges, for generating random sequences, you might want to research PLC built-in random number generation methods or use a pseudo-random number generation algorithm suitable for PLCs. As for the game failing to identify an incorrect sequence from the player - it seems like an issue that could be addressed by continually comparing the player's inputs with the current game sequence as they enter it. If a discrepancy occurs, you could use that information to trigger the game to announce an incorrect response. It would be easier to provide more specific advice if you could share a snippet of your code where you're encountering these issues. Keep going, you're on the right track!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. How can I introduce randomness to the game sequences in a Simon Says game developed using PLC technology?

Answer: Answer: To introduce randomness to the game sequences, you can utilize functions or algorithms that generate random numbers or patterns within the PLC code. This approach can help create more dynamic and challenging gameplay experiences.

FAQ: 2. How can I ensure that the Simon Says game can detect when a player enters an incorrect response within a given sequence?

Answer: Answer: To address this issue, you may need to implement error-checking mechanisms in the PLC code. This can involve comparing the player's input against the expected sequence and triggering appropriate actions or feedback when a mistake is detected. Testing and debugging this functionality are crucial to ensure accurate response identification.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’