plcgrasshopper
Member
OP
I'm trying to program a battleship game. If I press PB[0] (Spot A1), the square behind it, A[0] turns grey symbolizing a ship. I currently have this and I'm still getting a fault. BST XIC PB[0]-[127] MOV 1 A[0]-[127] NXB XIO PB[0]-[127] MOV 0 A[0]-[127] BNDWell, knowing the details of what you are doing and why you are doing it would be helpful. You may be using the wrong tool for the job.
Whatever is determining when/why you are indirectly switching between Bool[3] and Bool[4] needs to be limited to the values of 3 and 4.
What may make more sense is something like:
Code:BST XIC Condition XIC Bool[3] NXB XIO Condition XIC Bool[4] BND OTE DoSomething
If you are unfamiliar with what I posted above, add a new rung and double click the rung number. This a text box that gives you the text version of the rung, you can paste what I have above there to construct the rung. The tags won't exist, but you will be able to see the psudo-code a san actual rung.