Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
https://stationeering.com/tools/ic#eyJwcm9ncmFtIjoiYWxpYXMgVGFua0MwMiBkMFxyXG5hbGlhcyBWYWx2ZUhhdXB0IGQxXHJcbmFsaWFzIFZhbHZlQnlwYXNzIGQyXHJcbmFsaWFzIG1heHByZXNzdXJlIHIwXHJcbmFsaWFzIGFrdHByZXNzdXJlIHIxXHJcblxyXG5tb3ZlIHIwIDE0MDAwXHJcblxyXG5cclxuXHJcbmxpbmUgMTA6IGwgcjEgZDAgUHJlc3N1cmVcclxueWllbGRcclxuYmd0IHIxIHIwIDE4XHJcbnlpZWxkXHJcbmJsdCByMCByMSAyM1xyXG5cclxuXHJcblxyXG5saW5lIDE4OiBzIGQyIE9uIDFcclxucyBkMSBPbiAwXHJcbmogMTBcclxuXHJcblxyXG5saW5lIDIzOiBzIGQxIE9uIDFcclxucyBkMiBPbiAwXHJcbmogMTAiLCJyZWdpc3RlcnMiOnsiaW8iOlt7fSx7fSx7fSx7fSx7fSx7fSx7fV0sImlvQ29ubmVjdGVkIjpbdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZV0sImludGVybmFsIjpbMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDBdLCJpb1Nsb3QiOlt7fSx7fSx7fSx7fSx7fSx7fSx7fV0sImlvUmVhZ2VudCI6W3t9LHt9LHt9LHt9LHt9LHt9LHt9XX0sInJ1bkFmdGVyUmVnaXN0ZXJDaGFuZ2UiOmZhbHNlLCJydW5XaXRoRXJyb3JzIjpmYWxzZX0=
It will show you the problems
Basically your line number definitions are a problem, you can't have spaces in them
My advice it to hook up a console or two (small led display) and then write your actual pressure variable to one before the switch statements. And If that fails, at different parts of code. This way you will know what the value is at different points in code and will be able to easily find out whats wrong.
But there is a logical problem in the program:
line 12: bgt r1 r0 18
line 14: blt r0 r1 23
or in English:
if r1 > r0 jump to 18
if r0 < r1 jump to 23
If you think about it , "r1 > r0" is the same as "r0 < r1". I am not sure that this is what you are trying to achieve.
Also I recommend using line labels for jumps. Example
If you add a line of code, line 10 may become line 11 and you have to update it in the code. If you use labels, you can avoid this problem and also if you label things correctly, it will make the reading of the code easier.
it should say r1 > r0 and r1 < r0
thanks man i dont see this little mistake
yeah i think i would use labels for now its my first time so im happy that the program is working now :-)
It looks like a logical issiue, with the second branch.
and i would try it without a second r?
What you could try. For example
0. start:
1. alias TankCO d0
2. alias HValve d1
3. alias BValve d2
4. alias akt.Pressure r0
5. l r0 d0 Pressure
6. bgt r0 14000 Bypass
7. yield
8. blt r0 14000 Fill
9. j start
10.
11. Bypass:
12. s d1 On 0
13. s d2 On 1
14. j start
15.
16. Fill:
17. s d1 On 1
18. s d2 On 0
19. j start
I think this shoul work ;)
Glad I could help.
As the slightest change in your code with added lines and you need to alter those line numbers yet again.
Use loop or Start instead etc.
Use the aliases which you declare at the beginning. Use marks for jumps and make define statements for constants. Yield must only be used once for one loop. Happy programming!
alias TankC02 d0
alias ValveHaupt d1
alias ValveBypass d2
alias aktpressure r1
define maxpressure 14000
start:
l aktpressure TankC02 Pressure
bgt aktpressure maxpressure bypass
# if the expression above is false, the next line will be executed
# no need to test again and jump somewhere
s ValveHaupt On 1
s ValveBypass On 0
j end
# you could jump to start and put a yield there, but I prefer using a end part for having more structure inside the code
bypass:
s ValveBypass On 1
s ValveHaupt On 0
end:
yield
j start