Announcement

Collapse
No announcement yet.

tacho (stand alone) using 4D Intelligent Display Modules (Diablo16)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vince_4D
    replied
    Hi,

    For additional information, sys_T() function returns 16bit value and var type can only represent signed numbers ranging from -32768 to +32767.

    I would like to suggest that you use a similar routine below to avoid issues.

    Initialize this lines of code (before the repeat-forever loop)
    Code:
    sys_SetTimer(TIMER0,1000); // sets the TIMER0 to 1 sec
    sys_SetTimerEvent(TIMER0,timer); // when TIMER0 reaches 0, timer function is called
    Create a user-defined function.
    Code:
    func timer()
        txt_MoveCursor(0,0);
        count++;
        print("Timer: ",count,"  ");
        sys_SetTimer(TIMER0,1000); // sets agian the TIMER0 to 1 sec
    endfunc
    Also, can you please elaborate on the said problem?
    I still have a problem with it locking up the display if operated then stopped for some time then starting pulses again but working thru each register to find the problem.
    Best regards,


    Leave a comment:


  • hassle2
    replied
    Works well thank you, I still have a problem with it locking up the display if operated then stopped for some time then starting pulses again but working thru each register to find the problem. If you have any ideas let we know as I’m very new at programming.
    regards
    Kevin

    Leave a comment:


  • pauleilio
    replied
    Hi,

    Can you try using this line instead as it gives the same interval but doesn't behave the same.

    if((sys_T() - nowtime) >= 1000)

    Best regards

    Paul

    Leave a comment:


  • hassle2
    replied
    I have used some code from another post to count time(1000msecs) then display pulses counted.
    I have a problem with the code that every 65secs the display goes to zero for 1second then starts over again.
    var nowtime;

    revolutionCounter++;

    if(sys_T() >= (nowtime +1000))
    nowtime := sys_T();
    rpm = revolutionCounter *10;
    ( display code here)

    endif

    how do I set up the running nowtime counter so it does not go thru 32k then -32k where the display goes to zero.
    any help would great.



    Leave a comment:


  • hassle2
    replied
    Thank you for the link, I can counter pulses but how do I use timers to display the pulse count after one second and then reset counter and timer.

    Leave a comment:


  • Vince_4D
    replied
    Hi,

    Apologies, we just fixed the link issue and it should now be working.
    But you may also click this link to download the code.

    Best regards,
    Last edited by Vince_4D; 8th October 2018, 12:24 PM. Reason: link fixed

    Leave a comment:


  • hassle2
    replied
    project looks good but could not find code on this site just went about in circles. please help as I must be doing something wrong.

    Leave a comment:


  • Vince_4D
    replied
    Hi, welcome to the forum.

    I think this project would be very helpful in your project implementation.

    If you need further assistance, don't hesitate to inform us.

    Best regards,

    Leave a comment:


  • tacho (stand alone) using 4D Intelligent Display Modules (Diablo16)

    I'm building an engine info system
    for my motor home
    using a 24DT with VISI(not Genie) and have the temperature Forms and code running well, would like to include a tacho using cool gauge and a magnetic pickup.
    Need help with the code to count the pulses and up date the variable to be sent to display.
Working...
X