+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: How to Control Expression/Cpu updates

  1. #1
    Wire Amateur Cryosis's Avatar
    Join Date
    Jun 2007
    Posts
    36

    Default

    I just want to know if I can control the rate at which the expression chip is ran, I'm building a chip that has 10 inputs and about 10 outputs in single player, I think once it's finished it might cause some severe server related issues when I load it up in multi.... I just want the chip to consistently keep it's outputs but calculate changes from inputs once every tenth of a second or so...

    Also while I'm at it.. is there anyway to use brackets or anything to control if statements...

    And, I don't really see a difference between a CPU chip and an expression Chip, I can both load them the same way and they seem to do the same things...

    Any help would be greatly appreciated

  2. #2
    Wirererer EntropyGuardian's Avatar
    Join Date
    Apr 2007
    Posts
    154

    Default

    The expression gate runs its code every time its inputs change. If they don't change for 10 minutes, it won't run for 10 minutes. If it constantly changes it will constantly run its code. Not sure if it would be possible to throttle the speed. I have had some pretty lengthy expressions with tons of inputs constantly changing many many times and I don't think it has ever caused a portion of the lag caused by a single ship that isn't properly no-collided, or something like that.

  3. #3
    Wirererer Core Xii's Avatar
    Join Date
    May 2007
    Location
    Finland
    Posts
    393

    Default

    Hmm, what you do is add a Clk input to the expression gate (or whatever makes you fancy), and wire it to something that toggles it every Nth of a second. (I think that's a... square pulser, but divide its frequency input by two (since we only want to toggle once per cycle))

    Then enclose your ENTIRE expression gate code within this:
    Code:
    ~Clk ->
    *all your code goes here*
    ;
    Now the gate does all the execution only when we toggle the Clk input... which, when you wire it to a square pulser of frequency N / 2 where N is the actual frequency you want, does just that.

    So,

    Constant value of N / 2 -> Square pulse of frequency N -> Expression gate
    Grammar is the difference between "helping your uncle, Jack, off his horse" and "helping your uncle jack off his horse".

  4. #4
    Wire Noob jj6400's Avatar
    Join Date
    May 2007
    Posts
    4

    Default

    Just a thought: You could do what Core just said, but instead of enclosing the program with
    Code:
    ~Clk ->
    *all your code goes here*
    ;
    you could just use the first line as
    Code:
    !Clk -> end;
    Seems more simple to me, though thats just my opinion.
    ******When life gives you lemons set them on fire******
    **************and throw them at children!**************

  5. #5
    Wire Amateur Cryosis's Avatar
    Join Date
    Jun 2007
    Posts
    36

    Default

    hmmm I suppose that would work, theres no way that anything *jumps* into the code when an input comes in is there? Cause that would cause frightening problems with that idea,

    (still want to know diff between expression and cpu chip if anyones knows )

  6. #6
    Wirererer Core Xii's Avatar
    Join Date
    May 2007
    Location
    Finland
    Posts
    393

    Default

    (still want to know diff between expression and cpu chip if anyones knows )[/b]
    Easy question... check the expression gate documentation for a throughout answer.
    Grammar is the difference between "helping your uncle, Jack, off his horse" and "helping your uncle jack off his horse".

  7. #7
    Wire Sofaking tomb332's Avatar
    Join Date
    Mar 2007
    Location
    Birmigham,UK
    Posts
    1,377

    Default

    Basically.
    Expression gate is just a way of compressing things that use many gates into 1.
    CPU can act like a full blow computer almost, it acts independantly of its inputs and can use internal timeing and have upto 1024 inputs and 1024 outputs, also it can control hispeed devices using hispeed links which work far faster than normal wires.
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

    Super Easy Wire Download

  8. #8
    Wire Amateur Cryosis's Avatar
    Join Date
    Jun 2007
    Posts
    36

    Default

    ohhh so what I want to make is more like a CPU than an expression chip (I had read the documentation but was confused by the fact that the code will run in each)

    Is there documentation on how the CPU is called? If it's not called by inputs is it then automatically called X per frame?

  9. #9
    Wirererer Core Xii's Avatar
    Join Date
    May 2007
    Location
    Finland
    Posts
    393

    Default

    It has an internal clock so yea it runs "on its own", as opposed to the expression chip which only runs when its inputs change.
    Grammar is the difference between "helping your uncle, Jack, off his horse" and "helping your uncle jack off his horse".

  10. #10
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    Just for quick clarifaction:
    The expression gate, you put something in, you get something out. (calculator)
    The CPU, you don't put something in, you still get something out. (computer)

    So in a way the expression gate is a light-weight form of the CPU (NOTE! this is not all true, it is just to simplify), as someone mentioned, the expression gate is just a way to put many gates into one...

    If you need complex states, loops and other kinds of continous output then the CPU is your best bet.
    If you want to get results directly related to what you put in, the expression gate is your best bet.

    Perhaps kinda confusing, but it's hard to explain

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Submarine Control Expression help
    By ResidentCody in forum Expression 2 Discussion & Help
    Replies: 9
    Last Post: 03-21-2009, 05:37 AM
  2. Multi-Expression Control System
    By Beowulf in forum Wiremod General Chat
    Replies: 4
    Last Post: 03-17-2009, 11:53 AM
  3. Expression for a planes yaw control
    By Neotic in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 12-16-2008, 09:37 AM
  4. Tool : Expression (BETA 3) Chip Script : 10 port pod control
    By XeononyX in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 3
    Last Post: 04-10-2007, 07:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots