Tuesday, June 23, 2015

ALARM MESSAGE, EX1040 Lubrication Unit Alarm

Does anyone knows the solutions, if you know it please comment. This is from CNC User group indonesia

Atc not ready

Atc not ready... Does anyone know whether the sensor right or not.
 Tool change failed, i have try to twist manually, but i havent found the ready position.
If you know the solution please comment.

From CNC user group Indonesia

Understanding Keywords and Syntaxes of VB.NET

Visual basic.net keywords and syntaxes were similar with the previous version of visual basic. There are two terms in object oriented programming, including visual basic.net:
1.   Method: generic name for command in visual basic. The Sub and Function are types of Method.
2.   Instance: When a class created, the object created was the instance from the class definition.
There are some keywords and descriptions  you need to understand while programming on OOP:
Classes collection that provides related ablities, for example System.Drawing contains classes related with graphic.
Definition of object, including properties (variable) and method that can be a Sub or a Function.
Method that contains commands, enable data transferred as parameter and provide scope inside local variable, but doesn’t return value.
Method that contains commands, enable data transfered as parameter and provide scope inside local variables and commands.
Terminate Sub or Function currently executed. Can be combined with return value for function.
Declare and define new variable
Create new instance from object.
To indicate that a variable has no value. Similar with null in other proramming languages, or in database.
Reference to object inside the scope where the method executed.
Application type that run on command line. Console app in dot net usualy needed for testing purpose only. Console also referes to class that manage command window and can read and write text data.
Block of codes but not a class, can contain Sub or Function method. Used when there are only one code or data needed in the memory.
2.1  Compiler Options
Before you type codes, you need to set compiler options. There are many compiler options setup you can choose:
·         Option Explicit: This option don’t change from previous version of visual basic. If it’s activated or enabled. It will make sure that variabel declared explicitly. If you use Option Strict, this setting won’t be problem, because compiler don’t recognize the type of the undeclared variables. Basically, you dont have to use Option Explicit, unless you build a pure dynamic solution, where compilation time for typing unavailable.
·         Option Strict: When this option enabled, compiler will decide type of each variable. And if assignment between two variables need type conversion, eg: from integer to boolean, this conversion should be expressed explicitly.
·         Option Compare: This option make sure whether string has to be compared as string binary, or character has to be compared as text. Text comparation needs system to compare binary value saved internally before compared.
·         Option Infer: This option exists since VS 2008 and added because of LINQ requirement. When you execute LINQ statement, you will return data table that can’t be typed in statement Advanced.
2.2  Variable
Variable in programming language is a place to store information in computer memories. You can imagine a variable like an empty box, you can save some value in variable.
To add two numbers for example, you just write first number on an empty paper and put the paper on the empty box, then you write second number on an empty paper and put the second paper on the empty box.
In visual basic.net, this will be identical to this:
Dim number1 As Integer
Dim number2 As Integer
number1 = 3
number2 = 5
Codes above are codes in visual basic.net that describe how Visual Basic Net create and define variables.
Below are the explanations on several keywords used while defining variables:
Dim stands for Dimension”. This keyword used to declare variable type. By using this keyword, you are declaring a variable in visual basic.
This can be compared with an emtpy box, label and it’s content. This is variable. In other words, this is your storage area, the place where you save your value.
After the DIM, visual basic will name your variable. You can name the variable with everything you like. But there are some reserved words you may not use.
As Integer
This keywod describe the variabel type. Here, you tell visual basic that the variable will be an integer. This will define the box’s size, different type will make the size of the variable different.
number1 = 3
The “=” character means you insert something to your variable. Here, you tell visual basic to set 3 to variable number1.
2.3  Variable Types
Variable has many types. In VB.net, each variabel type will have it’s own scope. And can consume spaces in computer memory.
Boolean variable can contain True and False data. Inside the visual baisc, the value saved as number 1 and 0 it represent True and False.
Boolean value used as a conditional statement to determine whether some parts of the codes will be executed or not. It’s for controlling the flow of the program.
Char value contains one character, eg: “B”. Char value can be any characters. It can span from 0 to 65.553. It can also used to save data from ASCII table. Eg: Z can be used on char variable, and number 90 used in variable location.
Byte variable contains positive number from 0 to 255. Because the range is very small, you have to use byte variable wisely, if this variable inserted with negative value, or value bigger than 255, this will cause an error.
Date in visual basic can save date and time. Date should be inserted on #mm/dd/yyyy# format. For example May 23, 2016 will be declared as #5/23/2016#.
Visual basic use some mechanisms to work with Date variable. For example to count six months after today.
Decimal variable can save up to 29 decimal places. If you use decimal number, it’s okay using this variable. If you use non decimal number, then use integer.
Double variable used to save value that needs up to 28 decimal places. Double can be positive values from range 4.94065645841246544E-324 to 1.79769313486231570E+308 negative values from -1.79769313486231570E+30 to -4.94065645841246544E-324.
Double variable usually used to develop a scientific application and rarely used by regular developer.
Integer variable used to save number between -2,147,483,648 until 2,147,483,648. This integer variable can’t save values that has fractional value/decimal. If the value has fraction, it will be rounded automatically.
Object variable is a variable type that can be used to save all types of data. Because of this flexibility, object variable consume more memory space than other variable types. It’s not recommended to be used. Use specific type that you need.
Long variable used to save all numbers ranged from -9,233,372,036,854,775,808 to 9,233,372,036,854,775,807.
Short variable save number ranged from -32,768 to 32,767.
String variable save characters that can construct word or statements. String variable always opened and closed with quotation marks ("). For example "Hellow" or  "Hellow, how are you?".
Visual basic provides mechanisms to work with and manipulate strings. Table below details variables that hold number data type. :

Name in VB
8 bits (1 byte)
-128 to 127
8 bits (1 byte)
0 to 255
16 bits (2 bytes)
-32,768 to 32,767
16 bits (2 bytes)
0 to 65,535
32 bits (4 bytes)
-2,147,483,648 to 2,147,483,647
32 bits (4 bytes)
0 to 4,294,967,295
64 bits (8 bytes)
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
64 bits (8 bytes)
0 to 18,446,744,073,709,551,615

Variable types for floating points:
Name in VB
32 bit (4 bytes)
7 digits
1.5 x 10-45 to 3.4 x 1038
64 bit (8 bytes)
15-16 digits
5.0 x 10-324 to 1.7 x 10308
128 bit (16 bytes)
28-29 decimals
1.0 x 10-28 to 7.9 x 1028

Other prediefined:
Name in VB
Size (bit)
16 bit (2 bytes)
One unicode symbol ranges 0 to 65,535.
32 bit (4 bytes)
True or False
32/64 bit (4/8 bytes)
Platform dependent (reference to object).
64 bit (8 bytes)
January 1, 0001 12:00:00 AM to December 31, 9999 11:59:59 PM
80 + [16 * length] bit (10 + [2 * length] byte)
Unicode strings  with 2,147,483,647 characters maximum length.

To allocate a numeric value, you can use equal sign “=”. To allocate a certain numeric value to variable already declared, yo could use variable = certain_value.
For string and char variables, you can use quotation mark:
MystrVariable= "Some strings"
cMyhrVariable= "À"

For date/time, you can use hash/pound between value, by using this format #<month>/<day>/<year> <hour>:<minute>:<second> #. For example:
MyDateVariable= #7/4/2016 12:01:50 PM#
For other types, you don’t have to use anything.
myBytVariable = 1
mysbytVariable = -2
MyshrtVariable = 10S
MyushrtVariable = 10US
MyintVariable = 100
YouruIntVariable= 100UI
YourlnGVariable= 1000L
YouruLngVariable= 1000UL
sngVariable = 1.234F
dblVariable= 1.567R
decVariable = 1234567.89D
boolVariable = True
objctVariable = New Object

You can also allocate value to variable on it’s declaration, for example:
Dim myVariable As String = "Another String Values"
Visual Basic will allocate value from right variable to the left variable. Variabel in the left will take the value from the right variable. While the right variable’s value won’t change.

Sunday, April 26, 2015

Breaking News: Nepal earthquake

Lots of people died, a report shows that almost 2000 peoples died, and more missing. Let's hope for the best for Nepaleese.#PrayForNepalEarthQuake


A bank is a place where you are treated like a king on the beginning, and you are treated like a thief if the debt is unpaid/default #‎HeppyTrenggono‬, one of prominent indonesian moslem businessman.

Wednesday, April 15, 2015

Just wrote a visual basic.net book in english language

Hi guys, it has been a long time since i didn't update this blog.
Aarggghhh it must be caused by Facebook temptation.
But now i promise that i will blog regularly again.
O yeah , i just released a book on visual basic.net programming.
It's targeted for very beginners,
introducing visual basic net components,
syntaxes, and etc. You could see it here:
visua basic net cheap ebooks for beginners

Sunday, April 12, 2015

Bisnis Aliran Sesat

Ketika menjemput anak latihan TeKwonDo, menerima curhat seorang kolega, distributor telor yg sudah sekitar 5 tahunan berjualan telur yg mengeluhkan usahanya (yg menurut saya sebentar lagi bangkrut). Dengan wajah pasrah dia bercerita bahwa dia kekurangan hard cash.
Dia mencari-cari hutangan, dan minta dibantu dicarikan supplier yg bisa ngasih tempo, barangnya hendak dijual rugi, untuk kemudian diinvestasikan ke bisnis telornya. NB: Hati2 dengan pebisnis yg jual rugi barang, pasti lama2 cao (lari bahasa cina).
Sebuah bisnis itu sejogjanya membuat anda bertambah kaya, bukan bertambah miskin. Bisnis yg capek dikerjakan, juga harusnya membuat pemiliknya tambah beruang, bukan tambah berhutang.
Pebisnis yg sukses makin hari makin sedikit hutangnya hingga akhirnya bisa debt-free, bisa bebas hutang dan mulai maju dan melaju serta berinvestasi tanpa beban. Bukan dengan hutang yang tambah besar dan tambah berat jumlahnya, dengan dalih bisnisnya juga makin besar, jadi gapapa.
Banyak sekali pebisnis yg ikut aliran sesat, aliran berhutang dulu, padahal bisnis belum ada, bahkan ada yg sampai hutangnya milyaran, tapi bisnisnya bisnis sepele. Apakah tidak bisa mengambil pelajaran bahwa salah satu syekh aliran sesat dalam bisnis ini sudah sampai dibangkrutkan atau dipailitkan oleh pengadilan.
Pernah saya "diceramahi" oleh seorang pelanggan, mas kalau mau beli mobil itu jangan cash, itu bodoh. Soalnya mobil itu nilainya menurun terus. Mending uangnya dibuat usaha, lalu ambil mobilnya leasing diambil dari laba usahanya. Karena pelanggan, saya pun diam saja sambil membatin bahwa orang seperti ini 10 tahun lagi ga bakal kemana2 kemajuan bisnisnya.
Begitu pula dalam sebuah negara, negara yg dikelola dengan baik harusnya hutangnya tambah sedikit, dan lama2 habis, bukan malah ditambah terus. Pengelola pemerintahan yg mengandalkan hutang terus menerus juga adalah pengikut aliran bisnis yang sesat dan radikal.