Xnet Logic

1 view
Skip to first unread message

Albertina Drybread

unread,
Aug 5, 2024, 7:06:57 AM8/5/24
to sorbripridep
XNetis an item, fluid, energy, and information transportation mod that is all about efficiency. The cable system is designed in such way that you should be able to make huge cable systems without any overhead. Cables (for example) are not tile entities and have very simply models. This makes transporting items accross a cable of 12000 blocks long just as efficient as doing it on a 5 block long cable.

At the core of this mod is a network. A network is basically a single section of connected cables connected (via connectors) to various blocks (chests, machines, ...) and one controller. The controller is the block that does the actual work for that network.


Every network can have 8 channels maximum. Every channel has a type (energy, item, fluid, logic, ...) that you can configure in the controller. Depending on the type of a channel and the machines that are connected to that channel various things can happen.


You use connectors to connect machines to your network. Through that connector various channels (even with different types) can do their thing. Normal connectors only allow access through the side from which you are placing the connector. i.e. for a vanilla furnace that would mean that with a normal connector you can only get the melted result by placing a connector at the bottom of the furnace. Using advanced connectors you can overcome that limitation and access the down side of a furnace from any other side. Advanced connectors have other advantages. They allow higher speeds for item and fluid transfer (10 ticks minimum per operation as opposed to 20) and can store more RF (which means they can also transfer more RF).


One warning: an advanced energy connector can still not extract energy from another side. The reason for this is that it is actually the generator/producer itself that pushes energy and it will not do that through that other side. Insertion of energy to another side does work however.


Cables (and connectors) can have four different colors. These are used to be able to distinguish multiple distinct networks adjacent to each others (to prevent the cables from connecting). A controller will adapt its color to the first colored cable it can find around it and then remember that (unless that color is totally removed).


The logic channel is special. First one has to know that every network has seven colors (don't confuse these with cable colors) which is either enabled or disabled. By default all colors are disabled. Every connector (in the controller GUI) can be configured to be active only when a number (up to four) colors are active. Using a logic channel and sensors you can (based on various conditions) enable colors. For example, you can have one sensor detecting how much RF is left in a machine. And if that number goes below 1000 enable 'red'. Then another sensor can detect if there is enough coal in a chest and if true enable 'green'. Then you can have an item channel transporting coal to a coal generator but only when both 'red' and 'green' are enabled. So that means: only enable the coal generator is power is low and there is enough coal. Sensors themselves can also be enabled/disabled based on colors.


If you want to go beyond the 8 channel limit or you want to connect multiple distinct networks you can make a 'routing network' using routers. A single router is already sufficient to connect up to six (six sides of the router) channels but using routing cables and routing connectors you can also make a routing network out of routers. Note that on a single routing network you can only have 32 published channels.


Inside the GUI of the controller you can give a channel a name. This name isn't used anywhere except with the router that is directly attached to this network though a connector. Only channels that have a name will be visible locally in the routing GUI.


Every named channel can be published on a routing network (or with a router).This has to be done in the routing GUI by giving it a published name.The published name is the name with which that channel will be known on the routing network.Note that types are also considered.You have a published channel called 'foo' for items and another published channel called 'foo' for fluids on the same network, but they will not interact and only count as one channel for the channel limit.


One thing to note is that item and fluid transfer is always immediate.There are never items or fluids 'inside' the network.If there is no room for items or fluids to go too in a network then they will not leave their destination.


Power transfer works differently.Since RF and Forge Energy are 'push' systems (i.e. a powercell or generator pushes energy to adjacent machines) the connector needs to have an internal RF storage.The advanced connector can store more than the normal connector which means it can also transfer more.When you have an energy channel distributing energy to various machines then the power first has to go to the connector (pushed by the generator) and then it can be transferred to all machines that need it.


The goal of this setup is to make sure the top chest always contains at least one furnace.That's the only thing this does. As soon as you pull out that furnace it will start producing another one.To do this a crafter is used which is fed from that same chest (it contains cobble).The crafter also needs energy (and so does the controller).The left chest contains coal which is for the coal generator.The system makes sure that no coal is wasted.It will only insert coal if this is needed.The energy buffers of the crafter and controller are also not filled completely.


In this connector we simply extract whatever energy there is from the coal generator.This is then distributed to the controller and the crafter.In these connectors we also set a maximum (which isn't clearly visible because the input element for maximum is too small in this version) so that the power isn't needlessly wasted:


To produce energy the coal generator needs coal.Let's see how this is handled.First we extract the coal from the chest.We only do this if both 'red' and 'green' are enabled.We will see when these are enabled later in this tutorial, but basically they are enabled only when we don't have enough power and when there is enough coal:


We have a logic channel which measures when it is time to start producing energy, and it also senses if we have a furnace in the chest.First there is the sensor to check if we need energy and if there is enough coal:


First there are three local networks each limited to eight channels (for items, energy, fluid, logic).There is the green, the red, and the yellow channel.The green and the red channels are connected to router A.So they are local to that router. In fact one router is enough to connect different channels.You can publish channels from the red and green networks and connect them with each other.However, there is also a yellow network connected to router B.That's a remote network from the perspective of router A.To make channels available to other controllers you must publish them (give them a published name) in the router that they are connected too.Additionally, the channel must also have a name in the controller.


It provides automation solutions for high-level applications, this Programmable Logic Controllers can replace many products such as temperature controllers, impulse relays, timers, counters & control relays. Designed and developed in compliance with international quality standards, it Programmable Logic Controllers can be utilized for monitoring the state of input devices and to control the state of output devices. As it is a customized product, hence these logic controllers can be programmed according to user's requirements.


NI VeriStand provides a framework for real-time testing applications such as embedded software validation and real-time control and monitoring of mechanical test cell applications. The NI-XNET family of products includes a series of high-performance CAN, LIN, and FlexRay interfaces. These interfaces are optimized for applications that require real-time, high-speed manipulation of hundreds of CAN, LIN and FlexRay frames and signals, such as HIL simulation, rapid control prototyping, bus monitoring, automations control and more. This section will go through the installation process, configuring the VeriStand environment and setting up NI-XNET ports and databases.




After the first two steps are completed, the next step is to complete the installing software sections the Getting Started with VeriStand 2021 tutorial to complete the setup of the system based on the hardware in the system.


NI VeriStand uses projects to help get up and running quickly. To set up the project correctly and understand all the available options, complete the Create a Project section in the Getting Started with NI VeriStand tutorial.





Figure 1. The controller specification screen enables NI VeriStand to communicate with the appropriate device and at the specified target rate.


When the NI-XNET driver software is installed with NI VeriStand, an extensive set of NI VeriStand features are enabled that support communicating with hardware over the CAN, LIN, and FlexRay protocols. It may be helpful to understand NI-XNET related concepts and terminology in NI VeriStand before getting started by going through the Using NI-XNET, CAN, LIN and FlexRay Interfaces NI VeriStand Help.


There are many different configuration options available in NI VeriStand based on the hardware in the system. The sections below discuss the platforms that are available with NI-XNET. Select the appropriate hardware target to set up the NI VeriStand project for execution.




NI LabVIEW is required to use FPGA mode on the NI CompactRIO for the NI XNET 986x module. Below are the steps that will need to be followed to successfully set up the NI 986x XNET Module for use in NI VeriStand. The first eight steps are completed in NI LabVIEW and the last two steps are completed in NI VeriStand.

3a8082e126
Reply all
Reply to author
Forward
0 new messages