Welcome to Cockpitbuilders.com. Please login or sign up.

April 16, 2024, 03:17:45 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
50 Guests, 0 Users
Members
  • Total Members: 4,154
  • Latest: xyligo
Stats
  • Total Posts: 59,640
  • Total Topics: 7,853
  • Online today: 63
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 50
Total: 50

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

SIOC script to read bit offsets.

Started by dc8flightdeck, March 06, 2013, 06:19:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dc8flightdeck

Well, It didnt work like I hoped. I think these commands dont work for reading a bit, only to change them.

When I tried to import the txt file I got the following  error.


Open file "C:\IOCards\SIOC\Atest.txt"
9:21:16 AM
Phase 1
  .OK.

Phase 2
ERROR! - Unknow value
Line: 5    IF &radio = SETBIT 1
==> SETBIT
------------------------------------------------------------------------------------

Posted by: makoy
« on: Today at 06:53:50 AM »Insert Quote




Quote from: dc8flightdeck on Today at 12:17:13 AM

Im glad I noticed this thread, thats the first Ive the SETBIT/CLEARBIT. How about using this offset with the outputs card? I want to use the "good NAV1" offset to control the status light on the 737-200 AP indicator. Would this cause the offset to turn on and off the "good NAV1" on output 97? My switches are not connected through an opencockpits card so I dont need that action in SIOC.

Var 0001, name radio, Link FSUIPC_INOUT, Offset $3300, Length 2 // Additional radio and autopilot status indicatorsLIGHTS

Var 0002, name NAV1, Link IOCARD_OUT, Device 0, Output 97, //  good NAV1
{
   IF &radio = SETBIT 1
   {
       &NAV1 = 1
   }
   ELSE
   {
      IF &radio = CLEARBIT 1
      {
          &NAV1 = 0      }
   }
}


Justin





Hi Justin, i havent play with pedestall and radios yet, but it should work like that.

dc8flightdeck

I see SETBIT and CLEARBIT are function commands so understand why this only works to change the  bit and not to read it.

Im still trying to understand how to write "IF" script to read the condition of Offset $3300 bit 1 to turn on and off an output on the USB outputs card.

I hope to also be able to set up SIOC script to read the door $3367 bits as well. Im surprised there are no SIOC examples online.

dc8flightdeck

#2
Success!!!!  :) To read the bits I needed to use CHECKBIT. The following script is confirmed to read the position of door number 1 (the main door) in FSX. In a few weeks I look forward to posting video of the 737-200 door lights in action.


// * FileName : Door.txt
// * Date : 3/6/2013



Var 0001, name Exits, Link FSUIPC_IN, Offset $3367, Length 1     // Exit offsets
{
  &Exit1 = TESTBIT &Exits ,0 // 0 is for exit number one. 1 would indicate exit two.
}

Var 0002, name Exit1, Link IOCARD_OUT, Output 8     //  Exit 1 indicator

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate