Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Dear Pete,
 
I have already started, to built my own cockpit. Now I'm trying to change ECAM views of the airbusX with a lua script. I have a switch connected via Opencockpit I/O cards. The sioc script is the following.

I found out quite hard, that I have ti change letters into ASCII code and use offset with length 1 and write every letter separate.

But how can I get FSUIPC to know, the name is complete and to start the action.

 

Enclosed the Sioc sript.

 

 

Have a nice time over the years change.

 

Best regards

Jackson.

 

 

 

Var 201 Name Para, Link FSUIPC_OUT Offset $0D6C Length 4 // Parameter for Var 0202
Var 202 Name Prog1, Link FSUIPC_OUT Offset $0D70 Length 1 // Program 
Var 203 Name Prog2, Link FSUIPC_OUT Offset $0D71 Length 1
Var 204 Name Prog3, Link FSUIPC_OUT Offset $0D72 Length 1
Var 205 Name Prog4, Link FSUIPC_OUT Offset $0D73 Length 1
Var 206 Name Prog5, Link FSUIPC_OUT Offset $0D74 Length 1
Var 207 Name Prog6, Link FSUIPC_OUT Offset $0D75 Length 1
Var 208 Name Prog7, Link FSUIPC_OUT Offset $0D76 Length 1
Var 209 Name Prog8, Link FSUIPC_OUT Offset $0D77 Length 1
Var 210 Name Prog9, Link FSUIPC_OUT Offset $0D78 Length 1
Var 211 Name Prog10, Link FSUIPC_OUT Offset $0D79 Length 1
Var 212 Name Prog11, Link FSUIPC_OUT Offset $0D7A Length 1
Var 213 Name Prog12, Link FSUIPC_OUT Offset $0D7B Length 1
Var 214 Name Prog13, Link FSUIPC_OUT Offset $0D7C Length 1
Var 215 Name Prog14, Link FSUIPC_OUT Offset $0D7D Length 1
Var 0102 Name Eng_SW Link IOCARD_SW Input 2
{
IF &Eng_SW = 1
 {
  &Para = 160  
  &Prog1 = 76 // L
  &Prog2 = 117 // u
  &Prog3 = 97 // a
  &Prog4 = 32 // Leerzeichen
  &Prog5 = 65 // A
  &Prog6 = 83 // S
  &Prog7 = 95 // _
  &Prog8 = 65 // A
  &Prog9 = 105 // i
  &Prog10 = 114 // r
  &Prog12 = 98  // b
  &Prog13 = 117 // u
  &Prog14 = 115 // s
 }
}
Var 0104 Name Bleed_SW Link IOCARD_SW Input 4
{
IF &Bleed_SW = 1
 {
  &Para = 161
  &Prog1 = 76 // L
  &Prog2 = 117 // u
  &Prog3 = 97 // a
  &Prog4 = 32 // Leerzeichen
  &Prog5 = 65 // A
  &Prog6 = 83 // S
  &Prog7 = 95 // _
  &Prog8 = 65 // A
  &Prog9 = 105 // i
  &Prog10 = 114 // r
  &Prog12 = 98  // b
  &Prog13 = 117 // u
  &Prog14 = 115 // s
 }
}
Posted

I have already started, to built my own cockpit. Now I'm trying to change ECAM views of the airbusX with a lua script. I have a switch connected via Opencockpit I/O cards. The sioc script is the following.

I found out quite hard, that I have ti change letters into ASCII code and use offset with length 1 and write every letter separate.

 

Ugh! If you are using Lua, why not simply have a resident Lua plug-in (loaded by an [Auto] section) which uses event.offset to watch for changes to a selected user offset (such as 66C0) where your IOCARD driver can write a number for action?

 

BTW with strings you must write a zero at the end to terminate the string as well (this is actually included when you define strings like "string").

 

But how can I get FSUIPC to know, the name is complete and to start the action.

 

The facility to execute a macro operates immediately you write to 0D70, which is why you are supposed to write the whole string at once. Otherwise you'd need to write to 0D70 last.

 

Pete

Posted

Hi Pete,

 

thanks for your quick replay. I understud now, how to deal with tis two offsets. But according to the Lua plug-in, I have to dig out, how this works, but seems to be more comfortable.

Is there a place, where I can see an example of a script with an event.offset ?

I will go through your Lua documents, supplied with FSUIPC.

 

Jackson.

Posted

thanks for your quick replay. I understud now, how to deal with tis two offsets. But according to the Lua plug-in, I have to dig out, how this works, but seems to be more comfortable.

Is there a place, where I can see an example of a script with an event.offset ?

I will go through your Lua documents, supplied with FSUIPC.

 

Jackson.

 

There are all sorts of examples of different Lua plug-in methods in the ZIP file in your FSUIPC Documents about Lua plug-ins. You will probably also find lots of different examples in the User Contributions subforum.

 

I would help you once you make a start and try things, but my time is very limited until I return from holiday on the 9th -- I am not actually away yet, just preparing. ;-)

 

In any case there are others here who will be able to help. But be specific in your thread title so you attract the right responders (start a new thread).

 

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.