Page 1 of 5 12345 LastLast
Results 1 to 10 of 46
  1. #1
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    USBSteppers Card!

    Hiya all,

    I am trying to set the OC USBSteppers Card up. I have two Bi-Polar motors connected to the card.

    This is the script I'm using:

    Code:
    Var 0011, Link USB_STEPPER, Output 2, PosL 6, PosC 0, PosR 4, Type T
    
    Var 0002, name Step3, Link USB_STEPPER, Output 3, PosL 6, PosC 0, PosR 4
    
    Var 0001, name Step1, Link USB_STEPPER, Output 1, PosL 6, PosC 0, PosR 4
    
    Var 0112, name Switch7, Link IOCARD_SW, Input 222 // EVAC Toggle Switch
    {
     IF &Switch7 = 1
     {
      &Step1 = 180
      &Step3 = 180
     }
      ELSE
      {
       &Step1 = 255
       &Step3 = 255
      }
    }
    It's just a simple script that changes the speed of the motor based upon a switch press.

    However, whilst an output is definitely provided to the Stepper Motors, I just get a jerky, unstable movement from the Stepper Motor.

    The manual suggests this could be the motor itself, but after inspecting it AND trying a different motor I get the same results.

    Also, after testing with a multimeter, it is clear that pins 3 and 4 on "block 1" of the 5 pin connectors do not have any sort of output going to them; which is obviously useless if trying to get a BiPolar motor to work!

    If anyone has any ideas at all, please tell me what I've done wrong.

    Cheers,

    Jack

  2. #2
    500+ This must be a daytime job



    Join Date
    Jan 2007
    Location
    NEW ZEALAND
    Posts
    908
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    JACK,
    Have you set up the iostepper.ini file?. Does the stepper self calibrate properly.That is when you power it up and run IOstepper.exe the motor should spin and pass the sensor once then stop at the sensor on the second pass,does it do that correctly?. If this is correct run the script they provide as an example in the manual,it works fine.
    Les

  3. #3
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Hiya Les,

    Could you please tell me where the IOStepper.ini file is? The only reference I can find to any sort of ini file in the manual is SIOC.ini, which I have already set up correctly.

    Cheers,

    Jack

  4. #4
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Jack

    Apparently there are two manuals

    The one IWIK is referring to must be the manual which can be downloaded from the "shop" page where it says about halfway down

    CARD CONFIGURATION
    Card is configured with the file IOCStepper.ini

    etc etc etc


    The other manual which is amongst a whole page of manuals, does not I think mention the .ini file

    Suppose you could try both versions

    Regards

    David

    Edited for correction as there are two manuals

  5. #5
    500+ This must be a daytime job



    Join Date
    Jan 2007
    Location
    NEW ZEALAND
    Posts
    908
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Hi Jack,
    Just got up this morning and saw your message.
    Here is the link, and is what i used to test my software. Im not sure exactly how one is supposed to run the stepper. Before the latest sioc v4.0 it had been said that this software was not needed as it was built in to Sioc but had read people had trouble getting the stepper to work. So any testing ive done and i used the example to drive the compass from Fsim was to run iostepper.exe after setting the .ini file and then run at the same time sioc.exe with your script.
    Here is the link.

    http://www.opencockpits.com/modules....howpage&pid=53

    Hope thsi helps.
    Les

  6. #6
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Thank you everyone!

    After finding that second manual, I now have the Stepper motor running.

    But that's all I can get it to do; literally, just keep turning clockwise forever until I turn it off. I can adjust the speed slightly through the tweaking of the various .ini files and SIOC, but none are slow enough for my needs.

    I'm trying to use the Stepper motor as a Chronograph (ie synconise with the FS aircraft's clock). Are there any scripts for this like there is for Compass scripts?

    If it helps, the motor has 24 Steps per 360 degree turn, and it's Bi-Polar. It is set up in accordance to the OC manual for Bi-Polar motor and works well, but as you can see I can't really control it.

    I have absolutely zero experience with Stepper motors hence the post!

    Jack

  7. #7
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Are there any scripts for this like there is for Compass scripts?
    Jack

    Here you are courtesy of Carlos Lopez.

    Edit Just ran through the code again and noticed that it is IOCP based, however, may give you a starter for ten. Looks daunting though

    Regards

    David


    Code:
    // *****************************************************************************
    / / * Config_SIOC see 3.5 - By Manolo Velez - www.opencockpits.com
    // *****************************************************************************
    / / * FileName: clock-Cronometro.txt
    / / * Date: 20/01/2009
    // *****************************************************************************
    // -----------------------------------------------------------------------------
    / / Script developed by Carlos Lopez
    //
    //
    / / This clock stopwatch, based on the functioning available in the B737NG
    / / two 4-digit each display. In the upper visualizamos year, month and day
    / / or time in HH.MM or MM.SS, changing between These 4 options with the button
    / / TIME / DATE. Likewise the SET button activates the the digits flicker to modify them
    / / using the buttons + and -, so it's not must enter the FS to modify 
    / / date or time, but we can do directly from here,
    / / updated automatically on the FS.
    //
    / / In this Script I'm not using any timer mode to own the FS clock 
    / / is which will give the clock pulse to East Reloj-Cronómetro function.
    / / For this, the script rotates surrounding to the operation of offset 4 of the IOCP
    / / stores the data of the second FS clock.This is true, because I have seen
    / / to open any the FS menu option it for the clock, so it
    / / mode, always our clock always displayed the exact data of the FS.
    / / For this, has been created a general variable which provides various States
    / / di visualization of the displays. Therefore, in Depending on the value of that variable
    / / will act as the script. These are the different States of the Time_Date_Year variable
    //
    / / Time_Date_Year = 0
    / / Time_Date_Year = 1 Visualizo year
    / / Time_Date_Year = 2 Visualizo day and month
    / / Time_Date_Year = 3 Visualizo the Zulu time
    / / Time_Date_Year = 4 Visualizo minutes and Seconds
    //
    / / To modify the date or time, be pondran in intermittent decimal points of each
    / / digit. These connected are decimal points to two outputs of displays, using any of
    / / its segments so depending on of the value give that digit, is encenderán
    / / and/or apagarán corrrespondientes segments and by both the decimal points.
    / / Thus the use of outputs we ourselves save of the Master and cabling towards different connectors
    / / of the Master. I have connected the two points the two-digit left decimals to
    / / an output displays (exit 4) and the other two the right to another output points 
    / / display (exit 5).
    / / Digits turn for each decimal point are:
    / / If we send a 9 to the 4 output ignited the two the two-digit left points.
    / / If we send a 7 exit 4 turns on the point the 2, which would be the hundreds digit.
    / / If we send a 9-5 exit ignited the two the two-digit right points.
    //    
    / / Notice you turn on the point of the 2 digit for separate minutes, hours minutes
    / / the seconds or the day of month, depending on what that we are seeing.
    //
    / / We have two buttons for the control of the lower displays. The active CHR button 
    / / timer and button ET Elapsed Time or time partial. 
    //    
    / / CHR function. By clicking its button glows a led beside the push button that shows us that the 
    / / see in the display is the stopwatch. The second time that click we started. The third 
    / / stop it and so forth. If we want to put it to zero, click the RST button. The information 
    / / us shows in format mm:SS and when we come to 59: 59 again start timer from zero.
    //    
    / / Function ET. By clicking its button glows a led beside the push button that shows us that the 
    / / see in the display is the time Elapsed. The second time that click we started. The third 
    / / stop it and so forth. If we want to put it to zero, click the RST button. Information is 
    / / shows us format mm:SS during the first minute, then we see it in format HH_MM.
    //    
    / / To indicate in the lower display we see the Stopwatch (CHR) or Elapsed Time (ET) we use
    / / two LEDs next to each of the buttons activated. Also save outputs
    / / of the Master, we use a card connector of dispalys so according to the number that 
    / / represent, will be one of the power leds.
    / / If we are sending a 2 to display 14 glows led of the CHR to connected to the 5 pin connector 
    / / If we send a 5 to 14 display turns the led from the ET that connected with pin 2 of the connector 
    //    
    //
    / / The modification of the date takes into account If the year is leap or not, so that for
    / / know more about the calculation of the leap year:
    //    
    / / http://es.wikipedia.org/wiki/A%C3%B1o_bisiesto
    / / http://es.wikipedia.org/wiki/Algoritmo_bisiesto
    / / http://upload.wikimedia.org/wikipedia/commons/2/27/Graf_algo_bisiesto.PNG
    //
    // -----------------------------------------------------------------------------
     
     
     
    0000 Var, Value 0 / / Inicializacion of values of variables
     
    {
    &Time_Date_Year = 2    
    &Disp_Year = & Zulu_Year_Set
    &Year_to_Modif = & Zulu_Year_Set / / We pass the year to an internal vble
    &Modif_Year = 0
    &Disp_DWN_Pnt = 1
    &Estado_CHR = 0
    &CHR_ET_ToDisp = 0
    &Disp_CHR_ET = - 999999 / / Apagamos the Indicators LEDs of CHR-ET
    &Aguja_Segundos = 9000 / / move the the seconds to 15 needle to view the displays better
    }
     
    //
    // -----------------------------------------------------------------------------
    //
    / / OWN VARIABLES
    //
    // -----------------------------------------------------------------------------
    //
     
    Var 0010, name Time_Date_Year / / index for digit Time-date-Year
    Var 0012, name Modif_Year / / we activate control modification year. 0 = Descativado, 1 = enabled
    Var 0014, name Modif_DDMM / / we activate control modification Dia.Mes-> 0 = Descativado, 1 = month 2 = day
    Var 0016, name Year_to_Modif / / Guarda year for modify
    Var 0018, name DD_to_Modif / / saves the day for modify
    Var 0020, name MM_to_Modif / / saves the month for modify
    Var 0022, name CHR_ET_ToDisp / / controls if we see the CHR or the ET in the lower display. 0 = CHR 1 = ET
    Var 0024, name CHR_Min / / accumulates the minutes of the cronometro
    Var 0026, name CHR_Sec / / accumulates the second of the cronometro
    Var 0028, name Estado_CHR / / monitors the status of the CHR button. 0-> Pone crystals in display
    //                                                                   2 -> Inicia CHR o continúa
    //                                                   3 -> STOP timer.
    Var 0030, name ET_Hr / / accumulates the hours from the ET (Elapsed Time)
    Var 0032, name ET_Min / / accumulates the minutes of the ET (Elapsed Time)
    Var 0034, name ET_Sec / / accumulates the second of the ET (Elapsed Time)
    Var 0036, name Estado_ET / / monitors the status of the Button ET. 0-> Pone ET display
    //                                                                  2 -> Start ET or continues
    //                                                  3 -> STOP ET 
    Var 0037, name Limit_DD_Mes / / stores the total of days that has active month
    Var 0038, name DayofYear / / stores the day of the year
    Var 0039, Aguja_Segundos, USB_STEPPER, Output Link name 3, PosL 6, 0 PosC, PosR 4, Type H
     
    // -----------------------------------------------------------------------------
    //
    / / VARIABLES IOCP
    //
    // -----------------------------------------------------------------------------
     
    Var 0050, name Clock_Seconds, IOCP Link, offset 4 / / FS clock seconds
    {
    IF & Time_Date_Year = 1 / / Visualizo year
          {
    IF & Modif_Year = 1 / / if we are in control of the year activation  
                {
    &Disp_Pnt_Up_I = 9 / / Switch points of the year digits
    &Disp_Pnt_Up_D = 9 / / Switch points of the year digits
    &Disp_Pnt_Up_I = Delay - 999999 50 / / and the Apagamos with a half second delay
    &Disp_Pnt_Up_D = Delay - 999999 50 / / and the Apagamos with a half second delay
                }
          }
    IF & Time_Date_Year = 2 / / Visualizo day and month
          {
    IF & Modif_DDMM = 1 / / if we are in the modification month control activation
                {
    &Disp_Pnt_Up_D = 9 / / Switch points of the month digit
    &Disp_Pnt_Up_D = Delay - 999999 50 / / and the Apagamos with a half second delay
                }
    IF & Modif_DDMM = 2 / / if we are in the modification day control activation
                {
    &Disp_Pnt_Up_I = 9 / / Switch points of the day digit
    &Disp_Pnt_Up_I = Delay - 999999 50 / / and the Apagamos with a half second delay
                }
          }
    IF & Time_Date_Year = 3 / / Visualizo time Zulu
          {
    CALL & Show_Display
          }
    IF & Time_Date_Year = 4 / / Visualizo minutes and second
          {
    CALL & Show_Display
          }
          
    If & Estado_CHR = 2 / / 2-> starts CHR or continues
          {
    &CHR_Sec = & CHR_Sec + 1
    If & CHR_Sec > 59
                {
    &CHR_Sec = 0
    &CHR_Min = & CHR_Min + 1
    If & CHR_Min > 59 / / when We come to 1 hour zeros
                      {
    &CHR_Min = 0
                      }
                }
    &Aguja_Segundos = & CHR_Sec * 600 / / Move the needle of the seconds if the CHR this working
          }
     
    If & Estado_ET = 2 / / 2-> starts ET or continues
          {
    &ET_Sec = & ET_Sec + 1
    If & ET_Sec > 59
                {
    &ET_Sec = 0
    &ET_Min = & ET_Min + 1
    If & ET_Min > 59
                      {
    &ET_Min = 0
    &ET_Hr = & ET_Hr + 1
                      }
                }
          }
    If & CHR_ET_ToDisp = 0 / / show the CHR in the lower displays
          {
    Call & Ver_CHR
          }
          else / / show the ET on the lower displays
          {
    Call & Ver_ET
          }
    }
     
    Var 0052, name Zulu_Hour, IOCP Link, offset 5 / / time Zulu. Reading and writing
    {
    CALL & Show_Display
    }
     
    Var 0054, name Zulu_Minute, IOCP Link, offset 6 / / Minutes Zulu. Reading and writing
    {
    CALL & Show_Display
    }
     
    Var 0056, name Day_of_Year, IOCP Link, offset 7 / / Number of the day of the year. Reading and writing. Number days total per year
                                          
     
    Var 0058, name Day_of_Month, IOCP Link, offset 743 / / Day of the corresponding month. Read-only
    {
    CALL & Show_Display
    }
     
    Var 0060, name Current_Month, IOCP Link, offset 744 / / number of the month.  Read-only
    {
    CALL & Show_Display
    }
     
    Var 0062, name Zulu_Year_Set, IOCP Link, offset 8 / / Year. Reading and writing
    {
    &Year_to_Modif = & Zulu_Year_Set
    Call & Chk_Bisiesto / / Check whether is a leap
    }
     
    // -----------------------------------------------------------------------------
    //
    / / VARIABLES IOCARDS - DISPLAYS -
    //
    // -----------------------------------------------------------------------------
     
    Var 0100, name Disp_Year, IOCARD_DISPLAY Link, Digit 0, Numbers 4 / / UP Displays Year
    Var 0101, name Disp_Day_Hour, IOCARD_DISPLAY Link, Digit 2, Numbers 2 / / UP Displays Day or Hour
    Var 0102, name Disp_Month_Min, IOCARD_DISPLAY Link, Digit 0, Numbers 2 / / UP Displays Month or minutes
    Var 0104, name Disp_DWN_Min, IOCARD_DISPLAY Link, Digit 11, Numbers 2 / / Down Displays CHR - ET-> Min
    Var 0105, name Disp_DWN_Sec, IOCARD_DISPLAY Link, Digit 9, Numbers 2 / / Down Displays CHR - ET-> Sec
    Var 0110, name Disp_Pnt_Up_I, IOCARD_DISPLAY Link, Digit 4, Numbers 1 / / point decimal UP Displays
    Var 0111, name Disp_Pnt_Up_D, IOCARD_DISPLAY Link, Digit 5, Numbers 1 / / points decimals UP Displays
    Var 0112, name Disp_DWN_Pnt, IOCARD_DISPLAY Link, Digit 8, Numbers 1 / / point decimal Down Displays 
    Var 0114, name Disp_CHR_ET, IOCARD_DISPLAY Link, Digit 14, Numbers 1 / / be connecting indicators LEDs CHR/ET
     
    // -----------------------------------------------------------------------------
    //
    / / VARIABLES IOCARDS - TICKETS -
    //
    // -----------------------------------------------------------------------------
    //
     
    Var 0120, name SW_Time_Date, IOCARD_SW Link, Input 4, Type P / /----------------------------------> button TIME-DATE
    {
    IF & Modif_Year = 0 / / if not we are in the year-Set (SET button) control activation
          {
    &Time_Date_Year = & Time_Date_Year + 1
    IF & Modif_DDMM > 0 / / if I am modifying day month or month
                {
    &Modif_DDMM = 0
                }
          }
    IF & Time_Date_Year > 4 / / check if We exit of margin
          {
    &Time_Date_Year = 1 / / put to 1  
          }
          
    Call & Show_Display / / show in Displays the corresponding data
    If & Estado_CHR = 3 / / If the CHR this stopped
          {
    &Aguja_Segundos = 9000 / / move the seconds to 15 needle to view the displays better
          }
    }
     
    Var 0122, name SW_SET, IOCARD_SW Link, Input 2, Type P          // ----------------------------------> Botón SET
    {
    IF & Time_Date_Year = 1 / / If I am viewing the year
          {
    IF & Modif_Year = 0 / / If I am not modifying the year
                {
    &Modif_Year = 1 / / We activate control modification year
    &Year_to_Modif = & Zulu_Year_Set / / we pass the year to a vble to modify
                }
                else
                {
    Call & Chk_Bisiesto / / Check whether is a leap
    call & calc_DayofYear
    &Day_of_Year = &DayofYear / / we echo back the day to FS you change it
    &Modif_Year = 0 / / Disable control modification year
    &Zulu_Year_Set = & Year_to_Modif / / Echo the year to the FS you change it
    Call & Show_Display / / We show the year
                }
          }
     
    IF & Time_Date_Year = 2 / / if I am viewing the month day and month (DD.MM)
          {
    IF & Modif_DDMM = 0 / / if not I am modifying day of month and the month
                {
    &Modif_DDMM = 1 / / We activate control modification month
    &MM_to_Modif = & Current_Month / / we pass the month to a vble to modify
    &Disp_Pnt_Up_I = - 999999 / / Apagamos the points of the day digit
                }
                else
                {
    IF & Modif_DDMM = 1 / / if We are modifying the month we come to modify the day
                      {
    Call & Chk_DiasDelMes / / calculate few days has the month we modified
    &Modif_DDMM = 2 / / We activate control modification day
    &DD_to_Modif = &Day_of_Month / / we spent the day to a vble to modify
    &Disp_Pnt_Up_D = -999999 / / Apagamos points of the month digit
                      }
                      else / / we ended up of modified so that we send values to the FS
                      {
    call & calc_DayofYear
    &Day_of_Year = & DayofYear / / We echo back the day to FS you change it
    &Disp_Pnt_Up_I = - 999999 / / Apagamos the points of the day digit
    &Disp_Pnt_Up_D = -999999 / / Apagamos points of the month digit
    &Disp_Pnt_Up_I = 7 / / switch the separator point of DD and MM
    &Modif_DDMM = 0
    call & Show_Display
                      }
                }
          }
     
     
    }
     
    Var 0124, name SW_CHR, IOCARD_SW Link, Input 3, Type P               // ----------------------------------> Botón CHR 
     
    {     
    &Disp_CHR_ET = 2 / / switch the the CHR indicator led
    Call & Ver_CHR
    If & CHR_ET_ToDisp = 1 / / we have been from the ET function
          {
    &CHR_ET_ToDisp = 0 / / Acivamos control over the display to CHR
          }
          else / / already were in the CHR function 
          {
    &Estado_CHR = & Estado_CHR + 1 / / Change the CHR State
          }
    If & Estado_CHR > 3 / / Check limit of the State of the CHR 
          {                             
    &Estado_CHR = 2 / / 2-> Start CHR or continues 3-> STOP timer.
          }
    }
     
    Var 0125, name SW_ET, IOCARD_SW Link, Input 6, Type P                 // ----------------------------------> Botón ET
    {
    &Disp_CHR_ET = 5 / / switch the indicator led from the ET
    Call & Ver_ET
    If & CHR_ET_ToDisp = 0 / / we have been of the CHR function
          {
    &CHR_ET_ToDisp = 1 / / Acivamos control over the display for ET
          }
          else / / already were in the function ET
          {
    &Estado_ET = & Estado_ET + 1 / / Change state ET
          }
    If & Estado_ET > 3 / / check limit of the State of the ET
          {                             
    &Estado_ET = 2 / / 2-> Start ET or continues 3-> STOP ET
          }
    }
     
    Var 0126, Link IOCARD_SW, 7 Input Type P                            // ----------------------------------> Botón RST
    {
    If & CHR_ET_ToDisp = 0
          {
    &CHR_Min = 0 / / zero the minutes of the CHR
    &CHR_Sec = 0 / / zero the seconds of the CHR
    &Aguja_Segundos = 0
    Call & Ver_CHR           
          }
          else
          {
    &ET_Hr = 0 / / zero the the ET time
    &ET_Min = 0 / / zero the the ET minutes
    &ET_Sec = 0 / / zero the the ET seconds
    Call & Ver_ET
          }     
       
    }
     
    Var 0127, Link IOCARD_SW, Input 5, Type P / /----------------------------------> button +
    {
    IF & Modif_Year = 1 / / if we are in control of the year activation
          {
    &Year_to_Modif = & Year_to_Modif + 1
    &Disp_Year = & Year_to_Modif
          }
    IF & Modif_DDMM = 1 / / if we are in activation of the month control
          {
    &MM_to_Modif = & MM_to_Modif + 1
    If & MM_to_Modif > 12
                {
    &MM_to_Modif = 1
                }
    &Disp_Month_Min = & MM_to_Modif 
          }
    IF & Modif_DDMM = 2 / / if we are in the control of the day of activation
          {
    &DD_to_Modif = & DD_to_Modif + 1
    If & DD_to_Modif > & Limit_DD_Mes 
                {
    &DD_to_Modif = 1
                }
    &Disp_Day_Hour = & DD_to_Modif 
          }
    }
     
     
    Var 0128, Link IOCARD_SW, Input 1, Type P / /----------------------------------> button -
    {
    IF & Modif_Year = 1 / / if we are in control of the year activation
          {
    &Year_to_Modif = & Year_to_Modif - 1
    &Disp_Year = & Year_to_Modif
          }
    IF & Modif_DDMM = 1 / / if we are in activation of the month control
          {
    &MM_to_Modif = & MM_to_Modif - 1
    If & MM_to_Modif < 1
                {
    &MM_to_Modif = 12
                }
    &Disp_Month_Min = & MM_to_Modif 
          }
    IF & Modif_DDMM = 2 / / if we are in the control of the day of activation
          {
    &DD_to_Modif = & DD_to_Modif - 1
    If & DD_to_Modif < 1
                {
    &DD_to_Modif = & Limit_DD_Mes 
                }
    &Disp_Day_Hour = & DD_to_Modif 
          }
    }
     
    //
    // -----------------------------------------------------------------------------
    //
    / / SUBROUTINES
    //
    // -----------------------------------------------------------------------------
    //
     
     
    Var 0200, Show_Display, SUBRUTINE Link name / / Displays the year
    {
    &Disp_Pnt_Up_I = - 999999 / / Apagamos the separator point   
    &Disp_Pnt_Up_D = - 999999 / / Apagamos the separator point   
    IF & Time_Date_Year = 1 / / Visualizo year
          {
    &Disp_Year = - 999999 / / Apagamos the year     
    &Disp_Year = & Zulu_Year_Set     
          }
    IF & Time_Date_Year = 2 / / Visualizo day and month
          {
    &Disp_Day_Hour = & Day_of_Month  
    &Disp_Month_Min = & Current_Month    
    &Disp_Pnt_Up_I = 7    
          }
    IF & Time_Date_Year = 3 / / Visualizo time Zulu and minutes
          {
    &Disp_Day_Hour = & Zulu_Hour    
    &Disp_Month_Min = & Zulu_Minute    
    &Disp_Pnt_Up_I = 7      
          }
    IF & Time_Date_Year = 4 / / Visualizo minutes and second
          {
    &Disp_Day_Hour = & Zulu_Minute    
    &Disp_Month_Min = & Clock_Seconds    
    &Disp_Pnt_Up_I = 7    
          }
    }
     
     
     
    Var 0202, Ver_CHR, SUBRUTINE Link name / / go CHR to display
    {
    &Disp_DWN_Min = & CHR_Min / / We show the minutes of the CHR in display Down
    &Disp_DWN_Sec = & CHR_Sec / / We show the minutes of the CHR in display Down
    }
     
    Var 0204, Ver_ET, SUBRUTINE Link name / / go ET to the display
    {
    If & ET_Min = 0 / / during the first first minute show mm:SS
          {
    &Disp_DWN_Min = & ET_Min / / We show the minutes of the Te in display Down
    &Disp_DWN_Sec = & ET_Sec / / We show the seconds of the Te in display Down      
          }                 
          else / / after of the first minute We show hh: mm
          {
    &Disp_DWN_Min = & ET_Hr / / We show the time of the Te in display Down
    &Disp_DWN_Sec = & ET_Min / / We show the minutes of the Te in display Down
          }
    }
     
     
    Var 0206, Chk_Bisiesto, SUBRUTINE Link name / / check if the year is bisisesto
    {                                   
    L0 = MOD & Zulu_Year_Set, 4 / / L0 accumulates the rest of the Division
      IF L0 = 0
      {
    &Chk_Bisiesto = 1 / / no Leap = 0 leap = 1
      }
      ELSE
      {
    L0 = MOD & Zulu_Year_Set, 400
        IF L0 = 0
        {
    L0 = MOD & Zulu_Year_Set, 100
    IF L0 <> 0
          {
    &Chk_Bisiesto = 1 / / no Leap = 0 leap = 1
          }     
          ELSE
          {
    &Chk_Bisiesto = 0 / / no Leap = 0 leap = 1
          }
        }
        ELSE
        {
    &Chk_Bisiesto = 0 / / no Leap = 0 leap = 1
        }
      }
    }
     
    Var 0208, Chk_DiasDelMes, SUBRUTINE Link name / / Estimated few days have the month
    / / 31 days have JAN, SEA, MAY, JUL, AUG, OCT, DEC
    / / 30 days have APR, JUN, SEP, NOV
    / / 28 days has FEB except the leap that has 29
    {
    If & MM_to_Modif = 1 / / ENE
          {
    &Limit_DD_Mes = 31
          }
    If & MM_to_Modif = 2 / / FEB
          {
    If & Chk_Bisiesto = 0 / / if it is not leap
                {     
    &Limit_DD_Mes = 28
                }
                else / / if it is a leap
                {
    &Limit_DD_Mes = 29
                }
          }
    If & MM_to_Modif = 3 / / MAR
          {
    &Limit_DD_Mes = 31
          }
    If & MM_to_Modif = 4 / / ABR
          {
    &Limit_DD_Mes = 30
          }
    If & MM_to_Modif = 5 / / MAY
          {
    &Limit_DD_Mes = 31
          }
    If & MM_to_Modif = 6 / / JUN
          {
    &Limit_DD_Mes = 30
          }
    If & MM_to_Modif = 7 / / JUL
          {
    &Limit_DD_Mes = 31
          }
    If & MM_to_Modif = 8 / / AGO
          {
    &Limit_DD_Mes = 31
          }
    If & MM_to_Modif = 9 / / SEP
          {
    &Limit_DD_Mes = 30
          }
    If & MM_to_Modif = 10 / / OCT
          {
    &Limit_DD_Mes = 31
          }
    If & MM_to_Modif = 11 / / NOV
          {
    &Limit_DD_Mes = 30
          }
    If & MM_to_Modif = 12 / / DIC
          {
    &Limit_DD_Mes = 31
          }
    }
     
    Var 0210, Calc_DayofYear, SUBRUTINE Link name / / Calculates the day of the month in relation to the full year
    / / / / As well the ENE is 1 the calc_DayofYear = 1 and the 
    / / / / Dec 31 is the 365 except leap which is the 366
    {
     
    If & MM_to_Modif = 1 / / JAN 31 
          {
    &DayofYear = & DD_to_Modif / / Step to Calc_DayofYear the day of the month of January
          }
    If & MM_to_Modif = 2 / / 28 FEB
          {
    &DayofYear = & DD_to_Modif + 31 / / Agree me with the days of the month of the previous month
          }
    If & MM_to_Modif = 3 / / SEA 31 
          {
    &DayofYear = & DD_to_Modif + 59 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 4 / / APR 30 
          {
    &DayofYear = & DD_to_Modif + 90 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 5 / / MAY 31 
          {
    &DayofYear = & DD_to_Modif + 120 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 6 / / JUN 30 
          {
    &DayofYear = & DD_to_Modif + 151 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 7 / / JUL 31 
          {
    &DayofYear = & DD_to_Modif + 181 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 8 / / AUG 31 
          {
    &DayofYear = & DD_to_Modif + 212 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 9 / / SEP 30 
          {
    &DayofYear = & DD_to_Modif + 243 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 10 / / OCT 31 
          {
    &DayofYear = & DD_to_Modif + 273 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 11 / / NOV 30 
          {
    &DayofYear = & DD_to_Modif + 304 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif = 12 / / DEC 31 
          {
    &DayofYear = & DD_to_Modif + 334 / / Agree me with the days of the month from previous months
          }
    If & MM_to_Modif > 1
          {
    If & Chk_Bisiesto = 1 / / if it is leap
                      {     
    &DayofYear = & DayofYear + 1
                      }
          }     
    }

  8. #8
    500+ This must be a daytime job



    Join Date
    Jan 2007
    Location
    NEW ZEALAND
    Posts
    908
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Jack,
    Have you fitted an optical sensor and flag to your stepper. In case you dont know, you have to fit a little flag to the shaft of the stepper and this has to be adjusted to pass betweenan optical sensor to break a light source. Thsi tell the stepper where it is. When you first power up a stepper it will do one complete rev and then stop with the flag in the sensor. You have an input to stepper board from the sensor for each motor.
    Have you done this ,its explained in the manual i directed you to. To test if your sensor is ok. Place your meter on the sensor input to the stepper bd and rotate the flag in and out of the sensor.Thew meter should go between 5v and ov as the beam is interrupted..
    If your motor is continually turning then this sensor input is not working.
    Let us know how you get on.
    Les
    P.s The motor should turn and stop as soon as you run IOsteoer.exe. No code has to be run.

  9. #9
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Hi Les/David,

    I do not have any sort of Optical sensor installed. I wsa under the impression Stepper Motors could be operated open-loop.

    Is the optical sensor a DIY job or should it be purchased from somewhere? Are there any pictures available for my specific application?

    Cheers,

    Jack

  10. #10
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: USBSteppers Card!

    Jack

    READ THE FRIENDLY MANUAL

    There is a picture of the sensor and a rs online part number 304-560

    Regards

    David

Page 1 of 5 12345 LastLast